Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>_chmod() change access mode of file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_chmod()                 Change Access Mode of File

 #include   <dos.h>

 int        _chmod(filename,func[,attrib]);
 char       *filename;                   Name of existing file
 int        func;                        Operation to perform
 int        attrib;                      Attribute constant

    _chmod() can either retrieve or set the attributes of the file
    specified by 'filename'.  If 'func' is set to 0, _chmod() gets the
    current attributes.  If 'func' is set to 1, the attribute is set to
    'attrib'. 'attrib' can be one of the following constants:

                FA_RDONLY     Read only attribute
                FA_HIDDEN     Hidden file
                FA_SYSTEM     System file

    Returns:    If successful, _chmod() returns the file attribute word.
                On failure, a -1 is returned and 'errno' (defined in
                <stdlib.h>) is set to either:

                    ENOENT    Path or file name not found
                    EACCES    Permission denied

See Also: access() chmod() open() unlink()

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