class DIRECTORY
Summary
Tools for file-system directory handling. High-level facade for class BASIC_DIRECTORY.
Direct parents
Inherit list: FILE, TRAVERSABLE
Insert list: DIRECTORY_NOTATION_HANDLER
Class invariant
Overview
Creation features
{ANY}
Features
{ANY}
Disk access:
{}
Access:
{ANY}
File access:
{ANY}
{FILE}
{}
{ANY}
{DIRECTORY}
{}
{ANY}
Other features:
{ANY}
Agent-based features:
{ANY}
Printing:
{ANY}
{ANY}
{}
Agent-based features:
{ANY}
{}
Indexing:
{ANY}
writable attribute
{ANY}
The directory short name.
writable attribute
{ANY}
The directory path in use (see scan).
is_directory: BOOLEAN
is True
constant attribute
{ANY}
is_regular: BOOLEAN
is False
constant attribute
{ANY}
as_directory: DIRECTORY
effective function
{ANY}
require
  • is_directory
ensure
  • Result = Current
as_regular: REGULAR_FILE
effective function
{ANY}
require
  • is_regular
ensure
  • Result = Current
exists: BOOLEAN
writable attribute
{ANY}
has_file (a_file_name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
file (a_file_name: ABSTRACT_STRING): FILE
effective function
{ANY}
require
file_at (index: INTEGER_32): FILE
effective function
{ANY}
require
connect_directory (directory_path: ABSTRACT_STRING): FIXED_STRING
effective function
{}
connect_current_directory: FIXED_STRING
effective function
{}
scan (directory_path: ABSTRACT_STRING)
effective procedure
{}
Scans some existing directory_path which is supposed to be a correctly spelled directory path.
require
  • not directory_path.is_empty
scan_current_working_directory
effective procedure
{}
Scans the current working directory.
See also scan.
lower: INTEGER_32
is 1
constant attribute
{ANY}
Index of the first item.
upper: INTEGER_32
effective function
{ANY}
Index of the last item.
count: INTEGER_32
effective function
{ANY}
Number of items (files or directories) in Current.
ensure
  • Result >= 0
is_empty: BOOLEAN
effective function
{ANY}
Is the hoard empty ?
See also count.
ensure
  • definition: Result = count = 0
first: FIXED_STRING
effective function
{ANY}
The very first item.
See also last, item.
require
  • not is_empty
ensure
  • definition: Result = item(lower)
effective function
{ANY}
The last item.
See also first, item.
require
  • not is_empty
ensure
  • definition: Result = item(upper)
item (index: INTEGER_32): FIXED_STRING
effective function
{ANY}
Return the name of entry (file or subdirectory) at index.
require
  • valid_index(index)
ensure
has (entry_name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Does Current contain the entry_name (file or subdirectory) ?
require
  • not entry_name.is_empty
new_iterator: ITERATOR[FIXED_STRING]
effective function
{ANY}
ensure
  • Result /= Void
  • Result.generation = generation
connect_to_file_stream (file_stream: FILE_STREAM, filename: STRING)
effective procedure
{ANY}
Connect the file to the operating system file given by its filename.
require
  • not file_stream.is_connected
set_file (a_file_name: ABSTRACT_STRING, a_file: FILE)
effective procedure
require ensure
  • file(a_file_name) = a_file
file_set (a_file_name: ABSTRACT_STRING): BOOLEAN
effective function
case_canonical_filename (a_file_name: ABSTRACT_STRING): FIXED_STRING
effective function
{}
path_buffer: STRING
once function
{}
collection_sorter: COLLECTION_SORTER[FIXED_STRING]
writable attribute
{}
writable attribute
{}
writable attribute
{}
Actual list of entries (files or subdirectories).
create_file (a_file_name: FIXED_STRING): FILE
effective function
{}
require
file_tools: FILE_TOOLS
writable attribute
{}
parent: DIRECTORY
frozen
effective function
{ANY}
set_parent (a_parent: DIRECTORY)
effective procedure
ensure
parent_memory: DIRECTORY
writable attribute
{}
basic_directory: BASIC_DIRECTORY
writable attribute
{}
Provide low level access to directories.
enumerate: ENUMERATE[E_]
effective function
{ANY}
get_new_iterator: ITERATOR[E_]
frozen
effective function
{ANY}
This feature is obsolete: Use `new_iterator' instead. This historical SmartEiffel feature is badly named.
for_each (action: PROCEDURE[TUPLE[TUPLE 1[E_]]])
effective procedure
{ANY}
Apply action to every item of Current.
require
  • action /= Void
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Do all items satisfy test?
require
  • test /= Void
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
{ANY}
Aggregate all the elements starting from the initial value.
require
  • action /= Void
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
require
  • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
  • not_cleared: tagged_out_memory.count >= old tagged_out_memory.count
  • append_only: old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
generation: INTEGER_32
writable attribute
{ANY}
next_generation
effective procedure
{}
ensure
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
frozen
effective procedure
{ANY}
Apply action to every item of Current.
This feature is obsolete: Use `for_each` instead. This feature is not secure because it accepts a FUNCTION, the result of which is lost.
_inline_agent1 (a: ROUTINE[TUPLE[TUPLE 1[E_]]], e: E_)
frozen
effective procedure
{}
valid_index (i: INTEGER_32): BOOLEAN
effective function
{ANY}
True when i is valid (i.e., inside actual bounds).
See also lower, upper, item.
ensure