Update wikipage EiffelBase, The Kernel. (Signed-off-by:alexk).

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1805 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2017-03-23 10:03:45 +00:00
parent d429ef99f8
commit 69851939b8

View File

@@ -313,15 +313,13 @@ The class declaration defines files as unbounded sequences of characters. This m
{{caution|Note the application to input features of the command-query separation principle. <br/>
The input features such as read_integer do not by themselves return a result; they set the values of queries such as last_integer. So the normal way to read is through two operations:<br/>
<br/>
my_file.read_integer <br/>
new_value :&#61; my_file.last_integer }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_file.read_integer<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new_value :&#61; my_file.last_integer}}
Queries are available to determine the status of a file, in particular <eiffel>exists</eiffel>, <eiffel>is_readable</eiffel>, <eiffel>is_executable</eiffel>, <eiffel>is_writable</eiffel>, <eiffel>is_creatable</eiffel>, <eiffel>is_closed</eiffel>, <eiffel>is_open_read</eiffel> and so on.
{{caution|You will notice in the flat-short form that all these queries except the first have exists as a precondition. This precondition is good for efficiency since it saves an existence test - a relatively expensive operation - when you know that a certain file exists. But it also means that if you have any doubt about the file's existence you must use the queries in the style<br/>
<br/>
<code>if my_file.exists and then my_file.is_readable then</code>... }}
<eiffel>if my_file.exists and then my_file.is_readable then ...</eiffel>}}
FILE is a deferred class. Various implementations are possible. A quite detailed one is PLAIN_TEXT_FILE, which adds many features for accessing reading and writing data from/to a file.