file — file management
[unit [,err]]=file('open', file-name [,status] [,access [,recl]] [,format]) file(action,unit) [units [,typ [,nams [,mod [,swap]]]]] = file([unit])
string, file name of the file to be opened
string, The status of the file to be opened
file must not exist new file (default)
file must already exists.
unknown status
file is to be deleted at end of session
string, The type of access to the file
sequential access (default)
direct access.
string,
for a formatted file (default)
binary record.
integer,is the size of records in bytes when
access="direct"
integer, logical unit descriptor of the opened file
integer vector, logical unit descriptor of the opened files. Units 5 and 6 (%io) are reserved by the system for input and output devices.
Character string vector, type (C or Fortran) of opened files.
Character string vector, pathnames of opened files.
file opening mode. Formed by three digits abc
0 stands for formatted and 1 for unformatted (binary)
0 stands for sequential access and 1 for direct access
0 stands for "new", 1 for "old", 2 for "scratch" and 3 for "unknown"
is 1 if file has been opened with a "b" (binary) mode
automatic swap switch. swap=1 if automatic swap is on. swap is always 0 for Fortran files.
integer, error message number (see error), if open fails. If err is omitted an error message is issued.
is one of the following strings:
closes the file(s) given by the logical unit descriptors
given in units
puts the pointer at beginning of file
puts the pointer at beginning of last record.
puts the pointer after last record.
selects a logical unit unit
and manages the file
file-name
.
[unit [,err]]=file('open', file-name [,status] [,access
[,recl]][,format])
allows to open a file with specified
properties and to get the associated unit number unit
.
This unit number may be used for further actions on this file or as file
descriptor in read
, write
,
readb
,
writb
,save
, load
function calls.
This function can not open a UTF filename. In this case, please uses mopen.
file(action,unit)
allows to close the file , or
move the current file pointer .
file()
returns the logical unit descriptors of
the opened files. So file('close',file() )
closes all
user opened files (C or Fortran type).