CREATE
Advanced Programmer's Command
CREATE
filespec [(parameters)]
Creates a file named filespec and pre-allocates space for its future
contents.
You can use CREATE to prepare a file which will contain a known
amount of data. This usually speeds up file write operations. File
reading is also faster, since pre-allocated files are less segmented or
dispersed on the disk - requiring less motion of the read/write
mechanism to locate the records.
When a file
is
CREATEd, TRSDOS does not recover unused space at
the end of the file (each time you finish using it). If you exceed the
created size, TRSDOS allocates extra space for your file as you write
to
it.
The parameters are:
LRL=number
assigns number as the record length of filespec.
number
can be from 1 to 256. If you omit this parameter,
the record length defaults to 256.
REC =
number assigns the specified number of fixed-length
records to the file.
SIZE =
number allocates disk space to the file as number (in
K).
You have to specify
(1)
SIZE or
(2)
LRL and REC.
(For more information about record lengths and types, see "Disk
Files"
in
the Technical Reference Manual.)
CREATE also lets you permanently assign additional space to a file
that already exists. Use the appropriate parameters for the new file
size.
Examples
CREATE
NEWFILE/DAT:0 (LRL=128,REC=100)
(ENTER)
creates a file named NEWFILE/DAT
on
Drive 0 and allocates space
for one hundred 128-byte records.
CREATE
GOOD/OAT
(REC=50)
(ENTER)
creates a file named GOOD/DAT on the first available drive and
allocates space for fifty 256-byte records.
CREATE
INVENT/OAT
(SIZE=20)
(ENTER)
takes the already existing file named INVENT/DAT and increases its
size to
20K.
1-52