Download Timex tech info

Transcript
Timex tech info - FDD user manual
21 de 47
http://timex.comboios.info/tmxtechfdd.html
This describes what the file structure is expected to be. If the file is open as a
stream file, you can read or write a variable number of characters up to 256. If you
open the file as a record file, you can only read or write a fixed number of characters
the number you specified in the record-length parameter of the OPEN #* instruction.
Stream files are better suited to deal with information that has no special structure.
Record films have an underlying record structure and are particularly useful when
dealing with data bases, where a record holds information of a fixed length.
Stream files can only be read or written sequentially. When you perform consecutive
INPUT * instructions on a stream file, you read the characters one after the other.
Record files can be read or written in a random manner, you specify - using the 'AT'
statement - the number of the record you want to read with the PRINT * and INPUT *
instructions,
A file is accessed using a file pointer, understanding the concept is important. In
stream files the basic information unit is the character. In record files the basic
information unit is the record (which can have up to 256 charaters). If you want to
access a particular character in a certain record, you must read the entire record.
Whichever the basic information unit is, an open file always has a pointer pointing to
it. In stream files this file pointer points to the character which will be read or
written next. In record files, the file pointer points to the number of the record that
will be read or written next. Record files can also be accessed sequentially, record
after record.
When the OPEN #* instruction is executed, the file pointer is initialised to different
values, according to the mode parameter. If the file is open in input or output (stream
or record files) or random (record files), the file pointer is initialised to 1, even if
the file is empty.
If the file is open in the append mode, the file pointer is initialized with the file
size plus 1 (stream files) or with the number of records contained in the file plus 1
(record files), corresponding to the number of the character or record that is going to
be written next.
If you open a file in output only mode, all its previous contents will be destroyed.
Using the append mode the data is attached to the end of the file without overwriting
it.
A record file will be overwritten by specifying a record number lower than the last one
on the file. The changes made to a file become effective when you close it with the
CLOSE #* instruction.
You can also open and read or write SCP's, but the concepts just described vary. These
are described in the next chapter devoted to SCP's.
The following you cannot do with the OPEN #* instruction:
-Specify a channel already in use,
-specify a channel outside the range 1 to 16. Or a record outside the range 1 to 256.
-specify a directory as the argument
-Specify a pathname using a template
-Specify a random access file without a record length.
-Specify the opening of a file in write mode, that is using, output, random or append
modest to a file or disk which is write protected.
-----------------------------------------------------------------------------5.4 LIST *#
-----------------------------------------------------------------------------If a file or SCP is open the CAT * instruction displays an '0' under the 'S' field. To
know in which channel(s) the file is open, its mode, type (stream or record), use the
LIST *# instruction, which displays information on open files, and whose syntax is:
LIST *# [channel number]
The channel number is optional. If you specify it, TOS will only display information on
that channel. If you omit it, TOS will display information on all open channels.
13/12/2008 15:28