| www.delorie.com/djgpp/doc/libc-2.01/libc_138.html | search |
_dos_getfileattr@donoderef()
Syntax
#include <dos.h> unsigned int _dos_getfileattr(const char *filename, unsigned int *p_attr);
This function determines the attributes of given file and fills attr with it. Use the following constans (in DOS.H) to check this value.
_A_NORMAL (0x00)
_A_RDONLY (0x01)
_A_HIDDEN (0x02)
_A_SYSTEM (0x04)
_A_VOLID (0x08)
_A_SUBDIR (0x10)
_A_ARCH (0x20)
See section _dos_setfileattr.
Returns with 0 if successful and DOS error value on error (and sets errno=ENOENT).
unsigned int attr;
if ( !_dos_getfileattr("FOO.DAT", &attr) )
{
puts("FOO.DAT attributes are:");
if ( attr & _A_ARCH ) puts("Archive");
if ( attr & _A_RDONLY ) puts("Read only");
if ( attr & _A_HIDDEN ) puts("Hidden");
if ( attr & _A_SYSTEM ) puts("Is it part of DOS ?");
if ( attr & _A_VOLID ) puts("Volume ID");
if ( attr & _A_SUBDIR ) puts("Directory");
}
else
puts("Unable to get FOO.DAT attributes.");
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |