DOS Fn 3cH: Create a File via Handle
Compatibility: 2.0+
Expects: AH 3cH
DS:DX address of an ASCIIZ▲ string of a filespec▲
CX file attribute (can't be a volume label)
──────────────────────────────────────────────────────────────────
Returns: AX error code if CF is set to CY
file handle if no error
──────────────────────────────────────────────────────────────────
Info: Creates an empty file, or deletes all data from an existing file.
The file is open for read/write operations.
DS:DX points to an ASCIIZ string in the form...
d:\path\filename.ext◄0►
...which identifies the location and name of the file to create.
If drive and/or path are omitted, defaults are assumed.
If CF is set on return, an error code is in AX and no action was
taken.
Notes: ■ The file is opened with an Access Mode of read/write.
■ if the file already exists:
• When opened, it is truncated to a length of 0.
• If its file attribute is read-only, the open fails
(its attribute may be changed via Fn 4301H).
■ Fn 5bH (create new file) is similar, but fails if the file
already exists.
■ Fn 6cH has additional options, such as disabling critical
errors and forcing automatic write-through to disk.
See Also: Handle-Oriented File I/O
DOS Functions
-♦-