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

Syntax
------

     #include <dos.h>
     
     unsigned int _dos_creatnew(const char *filename, unsigned short attr, int *handle);

Description
-----------

This is a direct connection to the MS-DOS create unique function call
(%ah = 0x5B). This function creates the given file with the given
attribute and puts file handle into HANDLE if creating is successful.
This function will fail if the specified file exists. Meaning of ATTR
parameter is the following:

`_A_NORMAL (0x00)'
     Normal file (no read/write restrictions)

`_A_RDONLY (0x01)'
     Read only file

`_A_HIDDEN (0x02)'
     Hidden file

`_A_SYSTEM (0x04)'
     System file

`_A_ARCH (0x20)'
     Archive file

_dos_open:. _dos_creat:. _dos_read:.  *Note         
_dos_write::. _dos_close:    

Return Value
------------

Returns 0 if successful or DOS error code on error (and sets ERRNO).

Example
-------

     int handle;
     
     if ( !_dos_creatnew("FOO.DAT", _A_NORMAL, &handle) )
        puts("Creating was successful !");


See Also: _dos_open _dos_creat _dos_read _dos_close

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