Date: Wed, 30 Oct 1996 20:15:29 +0200 (IST) From: Eli Zaretskii To: Malcolm Taylor Cc: djgpp AT delorie DOT com Subject: Re: Setting Time/Date stamps of files. In-Reply-To: <557b47$14v@news.manawatu.gen.nz> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.