Re: file 'modified' dates [NEWBIE?]

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 08/28/02


On Wed, Aug 28, 2002 at 04:57:33PM -0700, Shane P. Lee wrote:
>> This isn't a C question, this is a linux question.
>Actually, I considered it a C question because I was looking
>for a library function. Geoff's prompt reply helped me to find
>the place in act.other.c where stat is used, I then searched the
>MSVC docs and found stat.h, a quick perusal was all I needed.
>> ANSI C doesn't provide a function to do this: the functions i'm
>> going to describe are available on a system that has POSIX
>> or BSD4.3 functions available.
>Okay, now I'm confused. Is stat() not an ANSI C function?!?

No.  It's not required to be in any ANSI libraries.  It's only required
to be on something that supports SVr4, SVID, POSIX, X/OPEN and 4.3BSD.
SVr4 and 4.3BSD added additional error conditions, and 4.3BSD introduced
st_blocks and st_blocksize fields in struct stat.  Some of the macros
for the filetypes, could, I guess, be considered non-POSIX, at least
according to the version of "man 2 stat" I'm looking at right now.  And
Unix_V7 defines some more macros as well with different names from the
POSIX ones.  (see the mentioned "man 2 stat" for all the gory details).
There may or may not be something similar in other (possibly ANSI)
libraries, but I can't think of one off-hand.

ObCircle:
On thinking about it, wouldn't this be a better (or at least nice
alternate) method for expiring pfiles in the ASCII pfile patch, since
the possibility of the field being corrupted in the file (last:) seems
just a little higher than the filesystem itself?  Checking the st_mtime
field would show the last time it was written, and I don't recall any
point (except set file) where normal operations require the file to be
read AND re-written except the player logging on, or someone guessing at
a password.

Just a thought.
/ObCircle


-me

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT