home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / FLSETATR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  914 b   |  39 lines

  1. /**
  2. *
  3. * Name        flsetatr -- Set file attributes
  4. *
  5. * Synopsis    ercode = flsetatr(pfile,attrib);
  6. *
  7. *        int  ercode      Returned DOS function error code
  8. *        char *pfile      File path name
  9. *        int  attrib      File attribute
  10. *
  11. * Description    This function sets the file attribute of the specified
  12. *        file.  See FLCREATE for the possible attributes.  Note
  13. *        that the attributes AT_VOLUME and AT_DIR may not be
  14. *        changed.
  15. *
  16. * Returns    ercode          DOS 2.0 function return error code
  17. *
  18. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  19. *
  20. **/
  21.  
  22. #include <bfile.h>
  23.  
  24. int flsetatr(pfile,attrib)
  25. char *pfile;
  26. int  attrib;
  27. {
  28.     DOSREG dos_reg;
  29.     ADS    file_ads;
  30.  
  31.     dos_reg.ax = 0x4301;          /* Function 0x43, set attribute */
  32.     dos_reg.cx = (unsigned)attrib;
  33.     utabsptr(pfile,&file_ads);
  34.     dos_reg.ds = file_ads.s;
  35.     dos_reg.dx = file_ads.r;
  36.  
  37.     return(dos(&dos_reg));
  38. }
  39.