delorie.com/djgpp/doc/libc/libc_180.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <dos.h> unsigned int _dos_setfileattr(const char *filename, unsigned int attr); |
This function sets the attributes of given file. Use the following constans in DOS.H to create attr parameter:
_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_VOLID (0x08)
Volume ID file
_A_SUBDIR (0x10)
Subdirectory
_A_ARCH (0x20)
Archive file
See section _dos_getfileattr.
This function does not support long filenames, even on systems where the LFN API (see section LFN) is available. For LFN-aware functions with similar functionality see _chmod. Also see chmod, which is Posix-standard.
Returns with 0 if successful and DOS error value on error (and sets
errno
to ENOENT or EACCES).
ANSI/ISO C | No |
POSIX | No |
if ( !_dos_setfileattr("FOO.DAT", _A_RDONLY | _A_HIDDEN) ) puts("FOO.DAT is hidden now."); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |