Function 3Ch            Create File with Handle

Creates a new file or opens and truncates an existing file to zero
length.

Entry AH = 3Ch
CX = File attributes
DS:DX = Pointer to ASCIIZ filename

Return AX = File handle, if CF clear
or
AX = Error code, if CF is set
| 03h Path not found
| 04h No handle available
| 05h Access denied (file is read-only,
| or root directory is full)

──────────────────────────────────────────────────────────────────

This function opens the file whose pathname is specified in the
ASCIIZ string at DS:DX. If the file doesn't already exist, it is
created. If a file with the specified name already exists, it is
truncated to zero length, effectively deleting the old data from
the file.

The file attributes passed in the CX register can be a combination
of the following values: attr_normal, attr_readonly, attr_hidden,
attr_system, attr_volume, and attr_archive.

When DOS creates a file, it opens the file with read-and-write
access and compatibility sharing mode and sets the file pointer to
zero (beginning of file). If the attribute read-only is specified
in CX, it takes effect only after the new file is closed.

Function 3Ch creates a volume label for the medium in the
specified drive only if CX specifies the attribute attr_volume and
the current medium does not have an existing volume label.

Function 4301h can be used to change a file's attributes.

Function 5Bh is similar to this function, but does not overwrite
the file if it already exists.