Path: utzoo!attcan!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: Fdatime under Laser C Keywords: Laser C Megamax Fdatime Message-ID: <1231@atari.UUCP> Date: 14 Nov 88 19:25:34 GMT References: <992@ncar.ucar.edu> Reply-To: apratt@atari.UUCP (Allan Pratt) Organization: Atari (US) Corporation, Sunnyvale, California Lines: 28 In article <992@ncar.ucar.edu> bovet@hao.ucar.edu (Ray Bovet) writes: > I'm having a terrible time trying to get Fdatime to modify > a file modification time and date stamp using Laser C. Fdatime had some problems in TOS 1.0 and 1.2 -- it's been changed for TOS 1.4 to be more sane. I don't remember exactly what the problem was, besides the documentation having the arguments wrong... The new Fdatime doesn't write to the disk at all: it writes to the open-file data structure, which gets written to disk when you close the file. This means that checking your write with Fsfirst won't work, because what's on the disk won't get updated until the file is closed. The correct usage is: Fwrite(timebuf,handle,flag); int *timebuf; /* ptr to two ints: time & date */ int handle; /* handle of file */ int flag; /* nonzero to write from timebuf */ If 'flag' is zero, the file's date & time are copied into the two ints at timebuf. If 'flag' is nonzero, the ints at timebuf are copied into the file's date & time fields. Since the date & time are updated each time the file is written to, you should make this call immediately before closing the file. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt