Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Function 3CH (decimal 60) opens an empty file using a specified name. If
  the file exists, function 3CH truncates it to zero length. If the file
  does not exist, function 3CH creates a new file. This function parallels
  function 16H (discussed on page 334).

  To invoke this function, create an ASCIIZ string containing the pathname
  and filename. The register pair DS:DX contains the address of the ASCIIZ
  string. CX contains the file attribute. (See page 113 for more on file
  attributes and attribute bit settings.) When function 3CH executes
  successfully, it clears the carry flag and returns a handle in AX.
  Otherwise, this function sets the carry flag and leaves an error code in
  AX. Possible error codes are 03H (path not found), 04H (no handle
  available), and 05H (access denied). Code 05H can indicate either that
  there is no room for a new directory entry or that the existing file is
  marked read-only and can't be opened for output.

  Be aware that by using function 3CH you can accidentally truncate an
  existing file to zero length. The best way to avoid this mistake is simply
  to call function 4EH to search the directory for an existing file before
  you call function 3CH. Or, if you are using DOS 3.0 or later, you have two
  other alternatives: You can call function 5BH, which works like function
  3CH but won't open an existing file, or you can use function 5AH to
  create a temporary file with a unique filename.

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