PostScript
4-25
file
filename
access
file
file
Creates a file object with specified file name and access. The
access
values are:
r
open the file for reading only
w
create a file if one does not already exist, or truncate and overwrite it if
it does exist. File is opened for writing only.
a
create a file if one does not already exist or append it if it does exist.
File is opened for writing only.
r+
open the file for reading and writing. An
undefinedfilename
error
occurs if the file does not exist.
w+
create a file if it does not already exist, or truncate and overwrite if it
does exist. File is opened for reading and writing.
a+
create a file if it does not exist or append it if it does exist. File is
opened for reading and writing.
This operator is in
systemdict
.
Errors:
invalidfileaccess, ioerror, limitcheck, stackunderflow, typecheck,
undefinedfilename
Note:
An
undefinedfilename
error occurs if the file does not exist.
filenameforall
pattern proc scratchstring
filenameforall
Lists all the files with names that match a specified pattern string, copies the file
name for each of these files into a specified scratch string, and calls a specified
proc
procedure. This operator is in
systemdict
.
Errors:
ioerror, stackoverflow, stackunderflow, typecheck
fileposition
file
fileposition
position
Indicates the current position on an open file. This operator is in
systemdict
.
Errors:
ioerror, stackunderflow, typecheck, undefinedfilename
Note:
An
undefinedfilename
error occurs if the file does not exist.