home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / io / _chmod.txh < prev    next >
Encoding:
Text File  |  1995-08-27  |  1.1 KB  |  38 lines

  1. @node _chmod, file system
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <io.h>
  6.  
  7. int _chmod(const char *filename, int func, mode_t mode);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This is a direct connection to the MS-DOS chmod function call, int
  13. 0x21, %ax = 0x4300/0x4301.  If @var{func} is 0, then DOS is called with
  14. AX = 0x4300, which returns an attribute byte of a file.  If @var{func}
  15. is 1, then the attributes of a file are set as specified in @var{mode}.
  16. Note that the directory and volume attribute bits must always be 0 when
  17. @code{_chmod()} is called with @var{func = 1}, or else the call will fail.
  18. The third argument is optional when getting attributes.
  19. The attribute bits are defined as follows:
  20.  
  21. @example
  22.   Bit       Meaning
  23. 76543210
  24. .......1    Read-only
  25. ......1.    Hidden
  26. .....1..    System
  27. ....1...    Volume Label
  28. ...1....    Directory
  29. ..1.....    Archive
  30. xx......    Reserved (used by some network redirectors)
  31. @end example
  32.  
  33. @subheading Return Value
  34.  
  35. If the file exists, @code{_chmod()} returns its attribute byte in case
  36. it succeded, or -1 in case of failure.
  37.  
  38.