home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name flretatr -- Return file attribute
- *
- * Synopsis ercode = flretatr(pfile,pattrib);
- *
- * int ercode Returned DOS function error code
- * char *pfile File path name
- * int pattrib Returned file attribute
- *
- * Description This function returns the file attribute of the
- * specified file. See FLCREATE for the possible
- * attributes.
- *
- * Returns ercode DOS 2.0 function return error code
- * *pattrib File attribute. If an error is encountered
- * -1 is returned.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bfile.h>
-
- int flretatr(pfile,pattrib)
- char *pfile;
- int *pattrib;
- {
- DOSREG dos_reg;
- int ercode;
- ADS file_ads;
-
- dos_reg.ax = 0x4300;
- utabsptr(pfile,&file_ads);
- dos_reg.ds = file_ads.s;
- dos_reg.dx = file_ads.r;
-
- ercode = dos(&dos_reg);
- if (ercode == 0)
- *pattrib = (int)dos_reg.cx;
- else
- *pattrib = -1;
-
- return(ercode);
- }