Function setftime

Top 

Declaration:

int setftime(long handle, unsigned long time);

Description

Sets the file date and time.

setftime sets the file date and time of the disk file associated with the open handle to the date and time provided in the time parameter. The file must be open for writing; the EACCES error will occur if the file is open for read-only access. The file must not be written to after the setftime call or the changed information will be lost. setftime requires the file to be open for writing; an EACCES error will occur if the file is open for read-only access. The time parameter has the following layout:

Bits      Value

---------------------

0...4     two seconds

5...10    minutes

11...15   hours

16...20   days

21...24   months

25...31   year - 1980

Returned Value

setftime returns 0 on success. In the event of an error, -1 is returned and the errno global variable is set to one of the following values:

EACCES       Permission denied

EBADF        Bad file number

EINVFNC      Invalid function number