home *** CD-ROM | disk | FTP | other *** search
- @node _dos_creat, dos
- @subheading Syntax
-
- @example
- #include <dos.h>
-
- unsigned int _dos_creat(const char *filename, unsigned short attr, int *handle);
- @end example
-
- @subheading Description
-
- This is a direct connection to the MS-DOS creat function call (%ah = 0x3C).
- This function creates the given file with the given attribute and puts
- file handle into @var{handle} if creating is successful. If the file
- already exists it truncates the file to zero length. Meaning of @var{attr}
- parameter is the following:
-
- @table @code
-
- @item _A_NORMAL (0x00)
-
- Normal file (no read/write restrictions)
-
- @item _A_RDONLY (0x01)
-
- Read only file
-
- @item _A_HIDDEN (0x02)
-
- Hidden file
-
- @item _A_SYSTEM (0x04)
-
- System file
-
- @item _A_ARCH (0x20)
-
- Archive file
-
- @end table
-
- @xref{_dos_open}. @xref{_dos_creatnew}. @xref{_dos_read}.
- @xref{_dos_write}. @xref{_dos_close}
-
- @subheading Return Value
-
- Returns 0 if successful or DOS error code on error (and sets @var{errno})
-
- @subheading Example
-
- @example
- int handle;
-
- if ( !_dos_creat("FOO.DAT", _A_ARCH, &handle) )
- puts("Creating was successful !");
- @end example
-