Numbered files
There are three ways open opening a numbered sequence of files. By
opening the first file in the sequence, by open with a filename
containing %d in place of the number or if the number is before
the extension by omitting the number entirely.
Using %d in the filename.
Using %d you can explicitly set the format of the file name to
be used. It is used by placing the %d in the filename where the
number is expected. name%d.xxx can be used to read a
sequence of files such as:
name1.xxx name2.xxx name3.xxx
If you wish the filenames to be zero padded you can add the
number of digits between the % and the d. So name%3d.xxx
can be used to read or write the following files:
name001.xxx name002.xxx name003.xxx
Opening the first file in the sequence.
If the file being opened cannot be interpreted as a stream
themselves (such as pnm ) you can just open the first file in
the sequence and the rest of the sequence will be found
automaticly. So you could open the following sequence,
name001.xxx name002.xxx name003.xxx
with the filename name001.xxx.
Omiting the number completely.
If the filename is in the form nameNNN.XXX where NNN is
some number and XXX is the extention. The file may be opened as
name.XXX provided there no file of that name exists. The
system will scan the directory for files which conform to this
format and work out the range of digits, and if zero padding is
being used.
Normal classes: