Chapter
1
I
System
Calls
Create
Create a File Function Call
3CH
Creates a new file
or
truncates an old file to zero length
in preparation for writing. If the file did not exist, then
the file is created in the appropriate directory and the
file is given the attributeb) found in
CX.
(See the section
“Disk Directory” in Chapter
4
for a discussion of file
at-
tributes.) The file handle returned has been opened
for
readlwrite access.
Entry Conditions:
AH
=
3CH
DS:DX
=
pointer
to
ASCZZZ
pathnume
CX
=
file attribute(s)
Exit Conditions:
Carry set:
Carry not set:
Error Returns:
AX
=
error
code
AX
=
file handle number
AX
AX
AX
=5
Access denied:
(1)
the attributes specified in
CX
in-
cluded one that could not be created (directory, vol-
ume ID)
(2)
file already existed with a more
inclusive set
of
attributes, or (3) a directory existed
with the same name.
=3
Path not found. The path specified was invalid.
=4
Too
many open files. The file was created with the
specified attributes but, either there were no free
handles available for the process,
or
the internal sys-
tem tables were full.
106