Mail Archives: djgpp/1996/10/30/13:45:55
On Wed, 30 Oct 1996, Malcolm Taylor wrote:
> I've run into a problem with lfn's and date/time stamps on files.
> After writing a file I wanted to set it's date and time and so I
> opened it again with _dos_open and used _dos_setftime to set it's
> date/time stamp. This doesn't work with lfns though (surprise
> surprise!). Is there a better/easier way?
Use `utime'. Not only does it support LFNs (in v2.01) and can set both
access and modification times on LFN platforms, but it also is more
portable (it's POSIX AFAIK).
> Is it possible to take a
> file opened for writing and set it's date/time stamp before it's
> closed (ie. take a FILE* and set it's date/time stamp)?
You better not rely on this for files that are open for writing, because
usually closing such files also changes the time stamp. If I understand
your situation correctly, using `utime' is easier since you don't have to
reopen the file.
- Raw text -