INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Access to file system facilities (files and directories manipulations)"
project: "Visual Eiffel Library"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: pool
class FILE_SYSTEM
inherit

FILE_SYSTEM_CONSTANTS
end
creation

make
feature {NONE}-- Creation

make
feature -- Clusters

current_cluster: STRING

parent_cluster: STRING

add_cluster (path, permissions: STRING)
-- Create new cluster `path'
require
path_not_empty: path /= void and then not path.is_empty
valid_perm: permissions /= void

deep_add_cluster (path, permissions: STRING)
-- Create new cluster `path' with all nested directories
require
path_not_empty: path /= void and then not path.is_empty
valid_perm: permissions /= void

remove_cluster (path: STRING)
-- Remove cluster `path'
require
path_not_empty: path /= void and then not path.is_empty

change_cluster (path: STRING)
-- Change current cluster to `path'
require
path_not_empty: path /= void and then not path.is_empty
exists: cluster_exists (path)

cluster_exists (path: STRING): BOOLEAN
-- Does cluster `path' exist?
require
path_not_empty: path /= void and then not path.is_empty

cluster_data (path: STRING): FSYS_DAT
-- Get all information available about
-- cluster `path'.
require
path_not_empty: path /= void and then not path.is_empty

cluster_count (path: STRING): INTEGER
-- Nr of files in cluster `path'
require
path_not_empty: path /= void and then not path.is_empty

subcluster_count (path: STRING): INTEGER
-- Nr of subclusters in cluster `path'
require
path_not_empty: path /= void and then not path.is_empty

cluster_list (path: STRING): ARRAY [FSYS_DAT]
-- Make a list of all subclusters of `path'.
require
path_not_empty: path /= void and then not path.is_empty
feature -- Files
-- NOTE: All pathnames must be understood as concatenations
-- of a cluster path with a filename.

add_file (path, permissions: STRING)
require
path_not_empty: path /= void and then not path.is_empty
valid_perm: permissions /= void

remove_file (path: STRING)
require
path_not_empty: path /= void and then not path.is_empty

copy_file (source_path, dest_path: STRING)
-- Copy the contents of file `source_path' onto file `dest_path'
require
paths_not_void: source_path /= void and dest_path /= void and then (not source_path.is_empty and not dest_path.is_empty)
write_permission: not file_exists (dest_path) or else file_exists (dest_path) and then has_writeperm (dest_path)
source_exists: file_exists (source_path)

rename_file (old_path, new_path: STRING)
-- Rename `old_path' -> `new_path'
require
paths_not_empty: old_path /= void and new_path /= void and then (not old_path.is_empty and not new_path.is_empty)
source_exists: file_exists (old_path)
target_is_new: not file_exists (new_path)

file_exists (path: STRING): BOOLEAN
-- Does file `path' exist?
require
path_not_empty: path /= void and then not path.is_empty

file_data (path: STRING): FSYS_DAT
require
path_not_empty: path /= void and then not path.is_empty

file_time (path: STRING): REAL
require
path_not_empty: path /= void and then not path.is_empty

file_perm (path: STRING): STRING
-- All permissions.
require
path_not_empty: path /= void and then not path.is_empty

has_readperm (path: STRING): BOOLEAN
-- May I read from file `path'?
require
path_not_empty: path /= void and then not path.is_empty

has_writeperm (path: STRING): BOOLEAN
-- May I write to file `path'?
require
path_not_empty: path /= void and then not path.is_empty

file_count (path: STRING): INTEGER
-- Nr. of bytes in file `path'.
require
path_not_empty: path /= void and then not path.is_empty

file_list (path: STRING): ARRAY [FSYS_DAT]
-- Make a list of all files in
-- cluster `path'
require
path_not_empty: path /= void and then not path.is_empty
feature -- Paths

path_suffix (path: STRING): STRING
-- Extract last component of `path'.

path_prefix (path: STRING): STRING
-- Extract all but last component of `path'

concat_paths (path1, path2: STRING): STRING
-- Create concatenation of paths.

absolute_path (path: STRING): STRING
-- Create absolute path from
-- (possibly) relative path.

same_path (path1, path2: STRING): BOOLEAN
-- Do `path1' and `path2'
-- actually represent the same
-- physical thing (file/cluster)?
require
non_void_path1: path1 /= void
non_void_path2: path2 /= void
end -- class FILE_SYSTEM

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES