abstract class $FILES
****

________This_is_the_generic_file/channel_abstraction_used_for_connecting
___the_program_to_external_objects_for_import/export_of_data.___This_is
___intended_to_include_such_things_as_ordinary_files,_pipes,_standard
___channels,_etc.___It_is_not_intended_to_cover_real_device_drivers!

________The_general_concept_is_that_a_file_contains_data_which_may_be
___imported_(eg_the_standard_input_channel)_or_exported_or_(possibly)
___both_(ie_updating_is_possible).

________The_whole_object_may_be_imported_at_once_using_the_appropriate
___implementation_version,_or_written_to_at_the_current_position.___No
___positioning_or_seeking_is_embodied_in_this_abstraction_(see,_however,
___$FILE_CURSORS).

___NOTE_File_deletion_is_a_facility_provided_by_a_DIRECTORY_class_object!


Descendants
TEXT_FILE BIN_FILE



Public


Features
clear ;
close ;
****
________This_operation_closes_the_connection_to_the_external_file_and
___invalidates_this_object_for_file_access.
create_for_update(name : STR) : SAME ;
create_for_write(name : STR) : SAME ;
create_temp : SAME ;
****
________These_three_file_creation_variants_force_creation_of_a_new_empty_file
___with_the_given_name_(or_a_dynamically_allocated_temporary_name)_for_the
___indicated_purpose.___By_its_very_nature_a_temporary_file_is_created_for
___update_--_and_is_automatically_deleted_on_closing.__Where_file_access
___control_of_any_kind_is_in_force_then_the_current_user_default_permissions
___are_given_to_the_file/channel.___These_may_be_changed_using_the_associated
___FILE_PROPS_object_operations.
error : BOOL ;
error_message : STR ;
is_open : BOOL ;
****
________This_predicate_returns_true_if_and_only_if_the_file_has_not_been_closed.
my_name : STR ;
open_at_end(name : STR) : SAME ;
open_at_end_for_update(name : STR) : SAME ;
****
________These_five_different_forms_of_object_creation_as_opening_indicate_the
___kinds_of_operation_which_it_may_be_desired_to_perform_on_the_file.
___It_is_an_error_in_all_cases_if_the_named_file_does_not_exist!___Note_that
___if_repositioning_is_desired_then_an_associated_file_cursor_must_be_used!
open_for_read(name : STR) : SAME ;
open_for_update(name : STR) : SAME ;
open_for_write(name : STR) : SAME ;
position : CARD ;
****
________This_routine_returns_the_current_position_of_a_notional_file_cursor
___providing_that_the_file_is_open,_otherwise_CARD::nil.
readable : BOOL ;
****
________This_predicate_returns_true_if_and_only_if_the_file_has_not_been
___closed_and_is_readable.
size : CARD ;
****
________This_routine_returns_the_current_size_of_the_file_as_the_number_of
___objects_contained.__If_the_contents_have_been_written_and_not_flushed_then
___the_value_returned_may_not_reflect_the_actual_contents_of_the_file_when
___flushed_and_closed.
update : BOOL ;
****
________This_predicate_returns_true_if_and_only_if_the_file_has_not_been
___closed_and_is_open_for_update.
writable : BOOL ;
****
________This_predicate_returns_true_if_and_only_if_the_file_has_not_been
___closed_and_is_writable.

The Sather Home Page