www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/10/02:14:52

Message-ID: <20000710061430.61180.qmail@hotmail.com>
X-Originating-IP: [208.160.246.197]
From: "Nimrod Abing" <n_abing AT hotmail DOT com>
To: djgpp AT delorie DOT com
Cc: eliz AT is DOT elta DOT co DOT il
Subject: Re: Other ways to get the time stamp of a file
Date: Mon, 10 Jul 2000 14:14:30 PHT
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Hello all.

>From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
>Reply-To: djgpp AT delorie DOT com
>To: john Latala <jrlatala AT golden DOT net>
>CC: djgpp AT delorie DOT com
>Subject: Re: Other ways to get the time stamp of a file
>Date: Sat, 08 Jul 2000 15:31:52 +0200
>
> > Date: Sat, 8 Jul 2000 06:10:01 -0400 (EDT)
> > From: john Latala <jrlatala AT golden DOT net>
> >
> > > How do I go about getting the time stamp of a file on disk other than
> > > using `stat'?
> >
> > Read the contents of the directory information right out of the 
>directory
> > 'file' from the harddisk.
>
>This is only possible by accessing the disk on the sector (i.e. BIOS)
>level, since DOS/Windows don't let you to open() a directory.
>
>Direct disk access of the kind that is needed for implementing your
>suggestion will tremendously slow down a program, to suc a degree that
>the whole issue of avoiding `stat' is null and void.

I wanted to avoid `stat' because I had to set this _djstat_flags thing
to ``optimize'' the function. I read in the libc info page that if a
program is a heavy user of the `stat' function, performance would be
degraded a bit since the function has to invent (read calculate) some
of the contents of the `stat' structure. I came to realize that if the
program `stat'ed a file stored on a slow device, all optimization would
go out the window. So using `stat' *is* more feasible and more portable.
Anyway, it was very enlightening to read some very clever suggestions
such as the sector level access. Thanks to all of you.

BTW. The program I am making is another unzip program. I'll be uploading
it to Simtel in a few days. (It doesn't mangle filenames the way unzip32
does. It simply truncates long filename 8.3 clean.)


----------------
_nimrod_a_abing_


------------------------------------------
Homepage: http://www.geocities.com/n_abing

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019