home *** CD-ROM | disk | FTP | other *** search
- @node _dos_getftime, dos
- @subheading Syntax
-
- @example
- #include <dos.h>
-
- unsigned int _dos_getftime(int handle, unsigned int *p_date, unsigned *p_time);
- @end example
-
- @subheading Description
-
- This function gets the date and time of the given file and puts these
- values into @var{p_date} and @var{p_time} variable. The meaning of
- DOS date in the @var{p_date} variable is the following:
-
- @example
- F E D C B A 9 8 7 6 5 4 3 2 1 0 (bits)
- X X X X X X X X X X X X X X X X
- *-----------------------* *-----------* *---------------*
- year month day
-
- year = 0-119 (relative to 1980)
- month = 1-12
- day = 1-31
- @end example
-
- The meaning of DOS time in the @var{p_time} variable is the following:
-
- @example
- F E D C B A 9 8 7 6 5 4 3 2 1 0
- X X X X X X X X X X X X X X X X
- *---------------* *-------------------* *---------------*
- hours minutes seconds
-
- hours = 0-23
- minutes = 0-59
- seconds = 0-29 in two-second intervals
- @end example
-
- @xref{_dos_setftime}.
-
- @subheading Return Value
-
- Returns 0 if successful and return DOS error on error (and sets
- @var{errno}=EBADF).
-
- @subheading Example
-
- @example
- unsigned int handle, date, time;
-
- _dos_open("FOO.DAT", O_RDWR, &handle);
- _dos_gettime(handle, &date, &time);
- _dos_close(handle);
- printf("FOO.DAT date and time is: %04u-%02u-%02u %02u:%02u:%02u.\n",
- /* year month day */
- ((date >> 9) & 0x7F) + 1980U, (date >> 5) & 0x0F, date & 0x1F,
- /* hour minute second */
- (time >> 11) & 0x1F, (time >> 5) & 0x3F, (time & 0x1F) * 2);
- @end example
-