home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name drretstp -- Return date/time stamp of open file
- *
- * Synopsis ercode = drretstp(handle,pfdate,pftime);
- *
- * int ercode DOS function return error code
- * int handle File handle of open file
- * unsigned *pfdate Pointer to returned date stamp
- * unsigned *pftime Pointer to returned time stamp
- *
- * Description This function returns the date and time stamp of the
- * file associated with the specified handle.
- *
- * The date and time are represented as 16-bit quantities
- * in the following format:
- *
- * ********** bits ***********
- * 1 1 1 1 1 1
- * 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- *
- * y y y y y y y m m m m d d d d d = fdate
- *
- * h h h h h m m m m m m s s s s s = ftime
- *
- * where the year bits represent 0 - 119 (1980 to 2099) and
- * the second bits represent two-second increments. This
- * is the same format used by DRSETSTP, DRSFIRST, and
- * DRSNEXT.
- *
- * Use DRSTP2DT and DRSTP2TM to split the time and date
- * stamps into year, month, day, etc.
- *
- * Returns ercode DOS error code
- * *pfdate File date stamp
- * *pftime File time stamp
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bdirect.h>
- #include <butility.h>
-
- int drretstp(handle,pfdate,pftime)
- int handle;
- unsigned *pfdate,*pftime;
- {
- DOSREG dos_reg;
- int ercode;
-
- dos_reg.ax = 0x5700; /* Function 0x57, return stamp */
- dos_reg.bx = handle;
- ercode = dos(&dos_reg);
- *pftime = dos_reg.cx;
- *pfdate = dos_reg.dx;
-
- return(ercode);
- }