indexing
description: "Sequential files, viewed as persistent sequences of characters"
status: "See notice at end of class"
date: "$Date$"
revision: "$Revision$"
deferred class interface
FILE
feature
make (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
file_named: name.is_equal (fn)
file_closed: is_closed
make_create_read_write (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
make_open_append (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_append: is_open_append
make_open_read (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_read: is_open_read
make_open_read_append (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_read: is_open_read
open_append: is_open_append
make_open_read_write (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
make_open_write (fn: STRING)
fn
require
string_exists: fn /= void
string_not_empty: not fn.is_empty
ensure
exists: exists
open_write: is_open_write
feature
access_date: INTEGER
require
file_exists: exists
date: INTEGER
require
file_exists: exists
descriptor: INTEGER
require IO_MEDIUM
valid_handle: descriptor_available
require else
file_opened: not is_closed
descriptor_available: BOOLEAN
file_info: UNIX_FILE_INFO
file_pointer: POINTER
group_id: INTEGER
require
file_exists: exists
has (v: like item): BOOLEAN
v
object_comparison
LINEAR
ensure CONTAINER
not_found_in_empty: Result implies not is_empty
index: INTEGER
LINEAR
index_of (v: like item; i: INTEGER): INTEGER
iv
object_comparison
LINEAR
require LINEAR
positive_occurrences: i > 0
ensure LINEAR
non_negative_result: Result >= 0
inode: INTEGER
require
file_exists: exists
item: CHARACTER
require TRAVERSABLE
not_off: not off
require ACTIVE
readable: readable
links: INTEGER
require
file_exists: exists
name: STRING
occurrences (v: CHARACTER): INTEGER
v
object_comparison
LINEAR
ensure BAG
non_negative_occurrences: Result >= 0
owner_name: STRING
require
file_exists: exists
position: INTEGER
protection: INTEGER
require
file_exists: exists
retrieved: ANY
Retrieve_exception
require IO_MEDIUM
exists: exists
is_open_read: is_open_read
support_storable: support_storable
ensure IO_MEDIUM
result_exists: Result /= void
separator: CHARACTER
ASCII
user_id: INTEGER
require
file_exists: exists
feature
count: INTEGER
feature
access_exists: BOOLEAN
after: BOOLEAN
before: BOOLEAN
changeable_comparison_criterion: BOOLEAN
object_comparison
CONTAINER
end_of_file: BOOLEAN
require
opened: not is_closed
exhausted: BOOLEAN
LINEAR
ensure LINEAR
exhausted_when_off: off implies Result
exists: BOOLEAN
ensure then
unchanged_mode: mode = old mode
extendible: BOOLEAN
file_prunable: BOOLEAN
file_readable: BOOLEAN
file_writable: BOOLEAN
Full: BOOLEAN is False
is_access_executable: BOOLEAN
require
file_exists: exists
is_access_owner: BOOLEAN
require
file_exists: exists
is_access_readable: BOOLEAN
require
file_exists: exists
is_access_writable: BOOLEAN
require
file_exists: exists
is_block: BOOLEAN
require
file_exists: exists
is_character: BOOLEAN
require
file_exists: exists
is_closed: BOOLEAN
is_creatable: BOOLEAN
is_device: BOOLEAN
require
file_exists: exists
is_directory: BOOLEAN
require
file_exists: exists
is_empty: BOOLEAN
FINITE
is_executable: BOOLEAN
require IO_MEDIUM
handle_exists: exists
is_fifo: BOOLEAN
require
file_exists: exists
is_inserted (v: CHARACTER): BOOLEAN
v
COLLECTION
is_open_append: BOOLEAN
is_open_read: BOOLEAN
is_open_write: BOOLEAN
is_owner: BOOLEAN
require
file_exists: exists
is_plain: BOOLEAN
require
file_exists: exists
is_plain_text: BOOLEAN
IO_MEDIUM
is_readable: BOOLEAN
require IO_MEDIUM
handle_exists: exists
is_setgid: BOOLEAN
require
file_exists: exists
is_setuid: BOOLEAN
require
file_exists: exists
is_socket: BOOLEAN
require
file_exists: exists
is_sticky: BOOLEAN
require
file_exists: exists
is_symlink: BOOLEAN
require
file_exists: exists
is_writable: BOOLEAN
require IO_MEDIUM
handle_exists: exists
last_character: CHARACTER
read_character
IO_MEDIUM
last_double: DOUBLE
read_double
IO_MEDIUM
last_integer: INTEGER
read_integer
IO_MEDIUM
last_real: REAL
read_real
IO_MEDIUM
last_string: STRING
IO_MEDIUM
object_comparison: BOOLEAN
equal=
=
CONTAINER
off: BOOLEAN
readable: BOOLEAN
SEQUENCE
require ACTIVE
True
require IO_MEDIUM
handle_exists: exists
support_storable: BOOLEAN
IO_MEDIUM
writable: BOOLEAN
SEQUENCE
feature
close
require IO_MEDIUM
medium_is_open: not is_closed
ensure then
is_closed: is_closed
compare_objects
equal
=
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
object_comparison
compare_references
=
equal
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
reference_comparison: not object_comparison
create_read_write
require
is_closed: is_closed
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
fd_open_append (fd: INTEGER)
fd
ensure
exists: exists
open_append: is_open_append
fd_open_read (fd: INTEGER)
fd
ensure
exists: exists
open_read: is_open_read
fd_open_read_append (fd: INTEGER)
fd
ensure
exists: exists
open_read: is_open_read
open_append: is_open_append
fd_open_read_write (fd: INTEGER)
fd
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
fd_open_write (fd: INTEGER)
fd
ensure
exists: exists
open_write: is_open_write
open_append
require
is_closed: is_closed
ensure
exists: exists
open_append: is_open_append
open_read
require
is_closed: is_closed
ensure
exists: exists
open_read: is_open_read
open_read_append
require
is_closed: is_closed
ensure
exists: exists
open_read: is_open_read
open_append: is_open_append
open_read_write
require
is_closed: is_closed
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
open_write
ensure
exists: exists
open_write: is_open_write
recreate_read_write (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
reopen_append (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_append: is_open_append
reopen_read (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_read: is_open_read
reopen_read_append (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_read: is_open_read
open_append: is_open_append
reopen_read_write (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_read: is_open_read
open_write: is_open_write
reopen_write (fname: STRING)
fname
require
is_open: not is_closed
valid_name: fname /= void
ensure
exists: exists
open_write: is_open_write
feature
back
require BILINEAR
not_before: not before
finish
require LINEAR
True
require else
file_opened: not is_closed
forth
require LINEAR
not_after: not after
require else
file_opened: not is_closed
go (abs_position: INTEGER)
position
require
file_opened: not is_closed
non_negative_argument: abs_position >= 0
move (offset: INTEGER)
offset
require
file_opened: not is_closed
next_line
require
is_readable: file_readable
recede (abs_position: INTEGER)
position
require
file_opened: not is_closed
non_negative_argument: abs_position >= 0
search (v: like item)
itemv
v
exhausted
object_comparison
BILINEAR
ensure LINEAR
object_found: (not exhausted and object_comparison) implies equal (v, item)
item_found: (not exhausted and not object_comparison) implies v = item
start
require TRAVERSABLE
True
require else
file_opened: not is_closed
feature
add_permission (who, what: STRING)
whowhat
require
who_is_not_void: who /= void
what_is_not_void: what /= void
file_descriptor_exists: exists
append (f: like Current)
f
require SEQUENCE
argument_not_void: s /= void
require else
target_is_closed: is_closed
source_is_closed: f.is_closed
ensure SEQUENCE
new_count: count >= old count
ensure then
new_count: count = old count + f.count
files_closed: f.is_closed and is_closed
basic_store (object: ANY)
object
require IO_MEDIUM
object_not_void: object /= void
exists: exists
is_open_write: is_open_write
support_storable: support_storable
change_date: INTEGER
require
file_exists: exists
change_group (new_group_id: INTEGER)
new_group_id
require
file_exists: exists
change_mode (mask: INTEGER)
mask
require
file_exists: exists
change_name (new_name: STRING)
new_name
require
new_name_not_void: new_name /= void
file_exists: exists
ensure
name_changed: name.is_equal (new_name)
change_owner (new_owner_id: INTEGER)
new_owner_id
require
file_exists: exists
extend (v: CHARACTER)
v
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then BAG
one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
fill (other: CONTAINER [CHARACTER])
other
other
COLLECTION
require COLLECTION
other_not_void: other /= void
extendible
flush
require
is_open: not is_closed
force (v: like item)
v
SEQUENCE
require SEQUENCE
extendible: extendible
ensure then SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)
general_store (object: ANY)
object
require IO_MEDIUM
object_not_void: object /= void
exists: exists
is_open_write: is_open_write
support_storable: support_storable
independent_store (object: ANY)
object
require IO_MEDIUM
object_not_void: object /= void
exists: exists
is_open_write: is_open_write
support_storable: support_storable
link (fn: STRING)
fn
fn
require
file_exists: exists
new_line
FILEput_new_line
require IO_MEDIUM
extendible: extendible
put (v: like item)
v
SEQUENCE
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then SEQUENCE
new_count: count = old count + 1
put_boolean (b: BOOLEAN)
b
FILEputbool
require IO_MEDIUM
extendible: extendible
put_character (c: CHARACTER)
c
FILEputchar
require IO_MEDIUM
extendible: extendible
put_double (d: DOUBLE)
d
FILEputdouble
require IO_MEDIUM
extendible: extendible
put_integer (i: INTEGER)
i
FILEputint
require IO_MEDIUM
extendible: extendible
put_new_line
FILEnew_line
require IO_MEDIUM
extendible: extendible
put_real (r: REAL)
r
FILEputreal
require IO_MEDIUM
extendible: extendible
put_string (s: STRING)
s
FILEputstring
require IO_MEDIUM
extendible: extendible
non_void: s /= void
putbool (b: BOOLEAN)
b
FILEput_boolean
require IO_MEDIUM
extendible: extendible
putchar (c: CHARACTER)
c
FILEput_character
require IO_MEDIUM
extendible: extendible
putdouble (d: DOUBLE)
d
FILEput_double
require IO_MEDIUM
extendible: extendible
putint (i: INTEGER)
i
FILEput_integer
require IO_MEDIUM
extendible: extendible
putreal (r: REAL)
r
FILEput_real
require IO_MEDIUM
extendible: extendible
putstring (s: STRING)
s
FILEput_string
require IO_MEDIUM
extendible: extendible
non_void: s /= void
remove_permission (who, what: STRING)
whowhat
require
who_is_not_void: who /= void
what_is_not_void: what /= void
file_descriptor_exists: exists
set_access (time: INTEGER)
time
require
file_exists: exists
ensure
acess_date_updated: access_date = time
date_unchanged: date = old date
set_date (time: INTEGER)
time
require
file_exists: exists
ensure
access_date_unchanged: access_date = old access_date
date_updated: date = time
stamp (time: INTEGER)
time
require
file_exists: exists
ensure
date_updated: date = time
touch
require
file_exists: exists
ensure
date_changed: date /= old date
feature
delete
require
exists: exists
dispose
IO_MEDIUM
prune_all (v: like item)
voff
SEQUENCE
require COLLECTION
prunable
ensure COLLECTION
no_more_occurrences: not has (v)
reset (fn: STRING)
fn
require
valid_file_name: fn /= void
ensure
file_renamed: name = fn
file_closed: is_closed
wipe_out
require COLLECTION
prunable
require else
is_closed: is_closed
ensure COLLECTION
wiped_out: is_empty
feature
linear_representation: LINEAR [CHARACTER]
LINEAR
feature
lastchar: CHARACTER
read_character
IO_MEDIUM
lastdouble: DOUBLE
read_double
IO_MEDIUM
lastint: INTEGER
read_integer
IO_MEDIUM
lastreal: REAL
read_real
IO_MEDIUM
laststring: STRING
IO_MEDIUM
feature
copy_to (file: like Current)
file
file
require
file_not_void: file /= void
file_is_open_write: file.is_open_write
current_is_open_read: is_open_read
feature
read_character
last_character
FILEreadchar
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_double
last_double
FILEreaddouble
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_integer
last_integer
FILEreadint
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_line
last_string
last_string
FILEreadline
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_real
last_real
FILEreadreal
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_stream (nb_char: INTEGER)
nb_char
last_string
FILEreadstream
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
read_word
last_string
FILEreadword
require
is_readable: file_readable
readchar
last_character
FILEread_character
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readdouble
last_double
FILEread_double
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readint
last_integer
FILEread_integer
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readline
last_string
last_string
FILEread_line
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readreal
last_real
FILEread_real
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readstream (nb_char: INTEGER)
nb_char
last_string
FILEread_stream
require IO_MEDIUM
is_readable: readable
require else
is_readable: file_readable
readword
last_string
FILEread_word
require
is_readable: file_readable
feature
do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
action
action
LINEAR
require TRAVERSABLE
action_exists: action /= void
do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
actiontest
actiontest
LINEAR
require TRAVERSABLE
action_exists: action /= void
test_exits: test /= void
for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
invariant
valid_mode: closed_file <= mode and mode <= append_read_file
name_exists: name /= void
name_not_empty: not name.is_empty
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
FINITE
empty_definition: is_empty = (count = 0)
non_negative_count: count >= 0
ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies (not readable) and (not writable)
BILINEAR
not_both: not (after and before)
before_constraint: before implies off
LINEAR
after_constraint: after implies off
TRAVERSABLE
empty_constraint: is_empty implies off
indexing
library: "[
EiffelBase: Library of reusable components for Eiffel.
]"
status: "[
Copyright 1986-2001 Interactive Software Engineering (ISE).
For ISE customers the original versions are an ISE product
covered by the ISE Eiffel license and support agreements.
]"
license: "[
EiffelBase may now be used by anyone as FREE SOFTWARE to
develop any product, public-domain or commercial, without
payment to ISE, under the terms of the ISE Free Eiffel Library
License (IFELL) at http://eiffel.com/products/base/license.html.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail <info@eiffel.com>
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"
end -- FILE