Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Files, viewed as persistent sequences of bytes" status: "See notice at end of class" date: "$Date: 2001/11/16 20:34:14 $" revision: "$Revision: 1.1.1.1 $" class interface RAW_FILE create make (fn: STRING) -- Create file object with fn as file name. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE file_named: name.is_equal (fn) file_closed: is_closed make_open_read (fn: STRING) -- Create file object with fn as file name -- and open file in read mode. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read make_open_write (fn: STRING) -- Create file object with fn as file name -- and open file for writing; -- create it if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_write: is_open_write make_open_append (fn: STRING) -- Create file object with fn as file name -- and open file in append-only mode. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_append: is_open_append make_open_read_write (fn: STRING) -- Create file object with fn as file name -- and open file for both reading and writing. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write make_create_read_write (fn: STRING) -- Create file object with fn as file name -- and open file for both reading and writing; -- create it if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write make_open_read_append (fn: STRING) -- Create file object with fn as file name -- and open file for reading anywhere -- but writing at the end only. -- Create file if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_append: is_open_append feature -- Initialization make (fn: STRING) -- Create file object with fn as file name. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE file_named: name.is_equal (fn) file_closed: is_closed make_create_read_write (fn: STRING) -- Create file object with fn as file name -- and open file for both reading and writing; -- create it if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write make_open_append (fn: STRING) -- Create file object with fn as file name -- and open file in append-only mode. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_append: is_open_append make_open_read (fn: STRING) -- Create file object with fn as file name -- and open file in read mode. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read make_open_read_append (fn: STRING) -- Create file object with fn as file name -- and open file for reading anywhere -- but writing at the end only. -- Create file if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_append: is_open_append make_open_read_write (fn: STRING) -- Create file object with fn as file name -- and open file for both reading and writing. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write make_open_write (fn: STRING) -- Create file object with fn as file name -- and open file for writing; -- create it if it does not exist. -- (from FILE) require -- from FILE string_exists: fn /= void string_not_empty: not fn.is_empty ensure -- from FILE exists: exists open_write: is_open_write feature -- Access access_date: INTEGER -- Time stamp of last access made to the inode. -- (from FILE) require -- from FILE file_exists: exists date: INTEGER -- Time stamp (time of last modification) -- (from FILE) require -- from FILE file_exists: exists descriptor: INTEGER -- File descriptor as used by the operating system. -- (from FILE) require -- from IO_MEDIUM valid_handle: descriptor_available require else -- from FILE file_opened: not is_closed descriptor_available: BOOLEAN -- (from FILE) file_info: UNIX_FILE_INFO -- Collected information about the file. -- (from FILE) file_pointer: POINTER -- File pointer as required in C -- (from FILE) group_id: INTEGER -- Group identification of owner -- (from FILE) require -- from FILE file_exists: exists has (v: like item): BOOLEAN -- Does structure include an occurrence of v? -- (Reference or object equality, -- based on object_comparison.) -- (from LINEAR) ensure -- from CONTAINER not_found_in_empty: Result implies not is_empty index_of (v: like item; i: INTEGER): INTEGER -- Index of i-th occurrence of v. -- 0 if none. -- (Reference or object equality, -- based on object_comparison.) -- (from LINEAR) require -- from LINEAR positive_occurrences: i > 0 ensure -- from LINEAR non_negative_result: Result >= 0 inode: INTEGER -- I-node number -- (from FILE) require -- from FILE file_exists: exists item: CHARACTER -- Current item -- (from FILE) require -- from TRAVERSABLE not_off: not off require -- from ACTIVE readable: readable links: INTEGER -- Number of links on file -- (from FILE) require -- from FILE file_exists: exists name: STRING -- File name -- (from FILE) occurrences (v: CHARACTER): INTEGER -- Number of times v appears. -- (Reference or object equality, -- based on object_comparison.) -- (from LINEAR) ensure -- from BAG non_negative_occurrences: Result >= 0 owner_name: STRING -- Name of owner -- (from FILE) require -- from FILE file_exists: exists position: INTEGER -- Current cursor position. -- (from FILE) protection: INTEGER -- Protection mode, in decimal value -- (from FILE) require -- from FILE file_exists: exists retrieved: ANY -- Retrieved object structure -- To access resulting object under correct type, -- use assignment attempt. -- Will raise an exception (code Retrieve_exception) -- if content is not a stored Eiffel structure. -- (from FILE) require -- from IO_MEDIUM exists: exists is_open_read: is_open_read support_storable: support_storable ensure -- from IO_MEDIUM result_exists: Result /= void separator: CHARACTER -- ASCII code of character following last word read -- (from FILE) user_id: INTEGER -- User identification of owner -- (from FILE) require -- from FILE file_exists: exists feature -- Measurement count: INTEGER -- Size in bytes (0 if no associated physical file) -- (from FILE) feature -- Status report access_exists: BOOLEAN -- Does physical file exist? -- (Uses real UID.) -- (from FILE) after: BOOLEAN -- Is there no valid cursor position to the right of cursor position? -- (from FILE) before: BOOLEAN -- Is there no valid cursor position to the left of cursor position? -- (from FILE) changeable_comparison_criterion: BOOLEAN -- May object_comparison be changed? -- (Answer: yes by default.) -- (from CONTAINER) end_of_file: BOOLEAN -- Has an EOF been detected? -- (from FILE) require -- from FILE opened: not is_closed exhausted: BOOLEAN -- Has structure been completely explored? -- (from LINEAR) ensure -- from LINEAR exhausted_when_off: off implies Result exists: BOOLEAN -- Does physical file exist? -- (Uses effective UID.) -- (from FILE) ensure then -- from FILE unchanged_mode: mode = old mode extendible: BOOLEAN -- May new items be added? -- (from FILE) file_prunable: BOOLEAN -- May items be removed? -- (from FILE) file_readable: BOOLEAN -- Is there a current item that may be read? -- (from FILE) file_writable: BOOLEAN -- Is there a current item that may be modified? -- (from FILE) Full: BOOLEAN is False -- Is structure filled to capacity? -- (from FILE) is_access_executable: BOOLEAN -- Is file executable by real UID? -- (from FILE) require -- from FILE file_exists: exists is_access_owner: BOOLEAN -- Is file owned by real UID? -- (from FILE) require -- from FILE file_exists: exists is_access_readable: BOOLEAN -- Is file readable by real UID? -- (from FILE) require -- from FILE file_exists: exists is_access_writable: BOOLEAN -- Is file writable by real UID? -- (from FILE) require -- from FILE file_exists: exists is_block: BOOLEAN -- Is file a block special file? -- (from FILE) require -- from FILE file_exists: exists is_character: BOOLEAN -- Is file a character special file? -- (from FILE) require -- from FILE file_exists: exists is_closed: BOOLEAN -- Is file closed? -- (from FILE) is_creatable: BOOLEAN -- Is file creatable in parent directory? -- (Uses effective UID to check that parent is writable -- and file does not exist.) -- (from FILE) is_device: BOOLEAN -- Is file a device? -- (from FILE) require -- from FILE file_exists: exists is_directory: BOOLEAN -- Is file a directory? -- (from FILE) require -- from FILE file_exists: exists is_empty: BOOLEAN -- Is structure empty? -- (from FINITE) is_executable: BOOLEAN -- Is file executable? -- (Checks execute permission for effective UID.) -- (from FILE) require -- from IO_MEDIUM handle_exists: exists is_fifo: BOOLEAN -- Is file a named pipe? -- (from FILE) require -- from FILE file_exists: exists is_inserted (v: CHARACTER): BOOLEAN -- Has v been inserted by the most recent insertion? -- (By default, the value returned is equivalent to calling -- `has (v)'. However, descendants might be able to provide more -- efficient implementations.) -- (from COLLECTION) is_open_append: BOOLEAN -- Is file open for appending? -- (from FILE) is_open_read: BOOLEAN -- Is file open for reading? -- (from FILE) is_open_write: BOOLEAN -- Is file open for writing? -- (from FILE) is_owner: BOOLEAN -- Is file owned by effective UID? -- (from FILE) require -- from FILE file_exists: exists is_plain: BOOLEAN -- Is file a plain file? -- (from FILE) require -- from FILE file_exists: exists is_plain_text: BOOLEAN -- Is file reserved for text (character sequences)? -- (from IO_MEDIUM) is_readable: BOOLEAN -- Is file readable? -- (Checks permission for effective UID.) -- (from FILE) require -- from IO_MEDIUM handle_exists: exists is_setgid: BOOLEAN -- Is file setgid? -- (from FILE) require -- from FILE file_exists: exists is_setuid: BOOLEAN -- Is file setuid? -- (from FILE) require -- from FILE file_exists: exists is_socket: BOOLEAN -- Is file a named socket? -- (from FILE) require -- from FILE file_exists: exists is_sticky: BOOLEAN -- Is file sticky (for memory swaps)? -- (from FILE) require -- from FILE file_exists: exists is_symlink: BOOLEAN -- Is file a symbolic link? -- (from FILE) require -- from FILE file_exists: exists is_writable: BOOLEAN -- Is file writable? -- (Checks write permission for effective UID.) -- (from FILE) require -- from IO_MEDIUM handle_exists: exists last_character: CHARACTER -- Last character read by read_character -- (from IO_MEDIUM) last_double: DOUBLE -- Last double read by read_double -- (from IO_MEDIUM) last_integer: INTEGER -- Last integer read by read_integer -- (from IO_MEDIUM) last_real: REAL -- Last real read by read_real -- (from IO_MEDIUM) last_string: STRING -- Last string read -- (from IO_MEDIUM) object_comparison: BOOLEAN -- Must search operations use equal rather than = -- for comparing references? (Default: no, use =.) -- (from CONTAINER) off: BOOLEAN -- Is there no item? -- (from FILE) readable: BOOLEAN -- Is there a current item that may be read? -- (from SEQUENCE) require -- from ACTIVE True require -- from IO_MEDIUM handle_exists: exists Support_storable: BOOLEAN is True -- Can medium be used to an Eiffel structure? writable: BOOLEAN -- Is there a current item that may be modified? -- (from SEQUENCE) feature -- Status setting close -- Close file. -- (from FILE) require -- from IO_MEDIUM medium_is_open: not is_closed ensure then -- from FILE is_closed: is_closed compare_objects -- Ensure that future search operations will use equal -- rather than = for comparing references. -- (from CONTAINER) require -- from CONTAINER changeable_comparison_criterion ensure -- from CONTAINER object_comparison compare_references -- Ensure that future search operations will use = -- rather than equal for comparing references. -- (from CONTAINER) require -- from CONTAINER changeable_comparison_criterion ensure -- from CONTAINER reference_comparison: not object_comparison create_read_write -- Open file in read and write mode; -- create it if it does not exist. -- (from FILE) require -- from FILE is_closed: is_closed ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write fd_open_append (fd: INTEGER) -- Open file of descriptor fd in append mode. -- (from FILE) ensure -- from FILE exists: exists open_append: is_open_append fd_open_read (fd: INTEGER) -- Open file of descriptor fd in read-only mode. -- (from FILE) ensure -- from FILE exists: exists open_read: is_open_read fd_open_read_append (fd: INTEGER) -- Open file of descriptor fd -- in read and write-at-end mode. -- (from FILE) ensure -- from FILE exists: exists open_read: is_open_read open_append: is_open_append fd_open_read_write (fd: INTEGER) -- Open file of descriptor fd in read-write mode. -- (from FILE) ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write fd_open_write (fd: INTEGER) -- Open file of descriptor fd in write mode. -- (from FILE) ensure -- from FILE exists: exists open_write: is_open_write open_append -- Open file in append-only mode; -- create it if it does not exist. -- (from FILE) require -- from FILE is_closed: is_closed ensure -- from FILE exists: exists open_append: is_open_append open_read -- Open file in read-only mode. -- (from FILE) require -- from FILE is_closed: is_closed ensure -- from FILE exists: exists open_read: is_open_read open_read_append -- Open file in read and write-at-end mode; -- create it if it does not exist. -- (from FILE) require -- from FILE is_closed: is_closed ensure -- from FILE exists: exists open_read: is_open_read open_append: is_open_append open_read_write -- Open file in read and write mode. -- (from FILE) require -- from FILE is_closed: is_closed ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write open_write -- Open file in write-only mode; -- create it if it does not exist. -- (from FILE) ensure -- from FILE exists: exists open_write: is_open_write recreate_read_write (fname: STRING) -- Reopen in read-write mode with file of name fname; -- create file if it does not exist. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write reopen_append (fname: STRING) -- Reopen in append mode with file of name fname; -- create file if it does not exist. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_append: is_open_append reopen_read (fname: STRING) -- Reopen in read-only mode with file of name fname; -- create file if it does not exist. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_read: is_open_read reopen_read_append (fname: STRING) -- Reopen in read and write-at-end mode with file -- of name fname; create file if it does not exist. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_read: is_open_read open_append: is_open_append reopen_read_write (fname: STRING) -- Reopen in read-write mode with file of name fname. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_read: is_open_read open_write: is_open_write reopen_write (fname: STRING) -- Reopen in write-only mode with file of name fname; -- create file if it does not exist. -- (from FILE) require -- from FILE is_open: not is_closed valid_name: fname /= void ensure -- from FILE exists: exists open_write: is_open_write feature -- Cursor movement back -- Go back one position. -- (from FILE) require -- from BILINEAR not_before: not before finish -- Go to last position. -- (from FILE) require -- from LINEAR True require else -- from FILE file_opened: not is_closed forth -- Go to next position. -- (from FILE) require -- from LINEAR not_after: not after require else -- from FILE file_opened: not is_closed go (abs_position: INTEGER) -- Go to the absolute position. -- (New position may be beyond physical length.) -- (from FILE) require -- from FILE file_opened: not is_closed non_negative_argument: abs_position >= 0 move (offset: INTEGER) -- Advance by offset from current location. -- (from FILE) require -- from FILE file_opened: not is_closed next_line -- Move to next input line. -- (from FILE) require -- from FILE is_readable: file_readable recede (abs_position: INTEGER) -- Go to the absolute position backwards, -- starting from end of file. -- (from FILE) require -- from FILE file_opened: not is_closed non_negative_argument: abs_position >= 0 search (v: like item) -- Move to first position (at or after current -- position) where item and v are equal. -- If structure does not include v ensure that -- exhausted will be true.