1
.TH file 1 "April 1993" "Scilab Group" "Scilab Function"
7
[unit [,err]]=file('open', file-name [,status] [,access [,recl]] [,format])
9
[units [,typ [,nams [,mod [,swap]]]]] = file([unit])
14
: string, file name of the file to be opened
17
: string, The status of the file to be opened
21
: file must not exist new file (default)
24
: file must already exists.
30
: file is to be deleted at end of session
34
: string, The type of access to the file
38
: sequential access (default)
49
: for a formatted file (default)
56
: integer,is the size of records in bytes when \fVaccess="direct"\fR
59
: integer, logical unit descriptor of the opened file
62
: integer vector, logical unit descriptor of the opened files. Units 1
63
5 and 6 are reserved by the system for history file , input and output
67
: Character string vector, type (C or Fortran) of opened files.
70
: Character string vector, pathnames of opened files.
73
: file opening mode. Formed by three digits abc
80
: 0 stands for formatted and 1 for unformatted (binary)
83
: 0 stands for sequential acces and 1 for direct access
86
: 0 stands for "new", 1 for "old", 2 for "scratch" and 3 for "unknown"
93
: is 1 if file has been opened with a "b" (binary) mode
96
: is 1 if file has been opened with a "+" (updating) mode
99
: 1 stands for "r" (read), 2 stands for "w" (write) and 3 for "a" (append)
104
: automatic swap switch. swap=1 if automatic swap is on. swap is
105
always 0 for Fortran files.
108
: integer, error message number (see error), if open fails. If err is
109
omitted an error message is issued.
112
: is one of the following strings:
116
: closes the file(s) given by the logical unit descriptors given in \fVunits\fR
119
: puts the pointer at beginning of file
122
: puts the pointer at beginning of last record.
125
: puts the pointer after last record.
128
selects a logical unit \fVunit\fR and manages the file
131
\fV[unit [,err]]=file('open', file-name [,status] [,access [,recl]]
132
[,format])\fR allows to open a file with specified properties and to
133
get the associated unit number \fVunit\fR. This unit number may be
134
used for further actions on this file or as file descriptor in
135
\fVread\fR, \fVwrite\fR, \fVreadb\fR, \fVwritb\fR,\fVsave\fR,
136
\fVload\fR function calls.
138
\fVfile(action,unit)\fR allows to close the file , or move the current
141
\fVfile()\fR returns the logical unit descriptors of the opened
142
files. So \fVfile('close',file() )\fR closes all user opened files (C
146
u=file('open',TMPDIR+'/foo','unknown')
155
u1=file('open',TMPDIR+'/foo','unknown')
156
u2=mopen(TMPDIR+'/foo1','wb')
157
[units,typs,nams]=file()
160
save, load, write, read, writb, readb, xgetfile, mopen, mclose