Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>function 3ch create file with handle</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: 4301h 5ah 5bh 6ch 59h Dev0Dh File attributes

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson