Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>_dos_setftime</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_dos_setftime
=============

Syntax
------

     #include <dos.h>
     
     unsigned int _dos_setftime(int handle, unsigned int date, unsigned time);

Description
-----------

This function sets the date and time of the given file. The meaning of
DOS date in the DATE variable is the following:

     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

The meaning of DOS time in the TIME variable is the following:

     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
     *-------* *---------* *-------*
       hours     minutes    seconds
     
     hours   = 0-23
     minutes = 0-59
     seconds = 0-29 in two-second intervals

_dos_getftime:.   

Return Value
------------

Returns 0 if successful and return DOS error on error (and sets
ERRNO=EBADF).

Example
-------

     struct dosdate_t d;
     struct dostime_t t;
     unsigned int handle, date, time;
     
     _dos_open("FOO.DAT", O_RDWR, &handle);
     _dos_getdate(&d);
     _dos_gettime(&t);
     date = ((d.year - 1980) << 9) | (d.month << 5) | d.day;
     time = (t.hour << 11) | (t.minute << 5) | (t.second / 2);
     _dos_settime(handle, date, time);
     _dos_close(handle);


See Also: _dos_getftime

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson