home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / compat / d_setfa.txh < prev    next >
Encoding:
Text File  |  1995-10-09  |  1008 b   |  61 lines

  1. @node _dos_setfileattr, dos
  2. @heading @code{_dos_setfileattr}
  3. @subheading Syntax
  4.  
  5. @example
  6. #include <dos.h>
  7.  
  8. unsigned int _dos_setfileattr(const char *filename, unsigned int attr);
  9. @end example
  10.  
  11. @subheading Description
  12.  
  13. This function sets the attributes of given file. Use the following
  14. constans in DOS.H to create @var{attr} parameter:
  15.  
  16. @table @code
  17.  
  18. @item _A_NORMAL (0x00)
  19.  
  20. Normal file (no read/write restrictions)
  21.  
  22. @item _A_RDONLY (0x01)
  23.  
  24. Read only file
  25.  
  26. @item _A_HIDDEN (0x02)
  27.  
  28. Hidden file
  29.  
  30. @item _A_SYSTEM (0x04)
  31.  
  32. System file
  33.  
  34. @item _A_VOLID (0x08)
  35.  
  36. Volume ID file
  37.  
  38. @item _A_SUBDIR (0x10)
  39.  
  40. Subdirectory
  41.  
  42. @item _A_ARCH (0x20)
  43.  
  44. Archive file
  45.  
  46. @end table
  47.  
  48. @xref{_dos_getfileattr}.
  49.  
  50. @subheading Return Value
  51.  
  52. Returns with 0 if successful and DOS error value on error (and sets
  53. @var{errno} to ENOENT or EACCES).
  54.  
  55. @subheading Example
  56.  
  57. @example
  58. if ( !_dos_setfileattr("FOO.DAT", _A_RDONLY | _A_HIDDEN) )
  59.    puts("FOO.DAT is hidden now.");
  60. @end example
  61.