home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!thinkage!atbowler
- From: atbowler@thinkage.on.ca (Alan Bowler)
- Subject: Re: file dates
- Message-ID: <1992Sep9.211012.16124@thinkage.on.ca>
- Organization: /etc/organization
- References: <1992Sep8.134608.1255@siesoft.co.uk>
- Date: Wed, 9 Sep 1992 21:10:12 GMT
- Lines: 27
-
- In article <1992Sep8.134608.1255@siesoft.co.uk> tomc@siesoft.co.uk writes:
- >Can someone explain to me how to read a files date? I have been looking
- >through the manual pages, but there are a lot missing on the machine I
- >am using. Basically, I am writing a queue processor, where each job in
- >the queue is a file in a specific directory. I just need to be able to
- >process these jobs in chronological order, then move the file to another
- >directory. Is there an easy way of finding the earliest file in a directory?
- >
- I suggest that you ask this in a group specific to your operating
- system. When you do be specific about what dat/time you mean.
- Different operating systems mainatin a number of different date/time
- stamps for each file.
- - when the file was created
- - when the attributes (name, permissions etc) were last changed
- - when the content was last changed
- - This may instead be when the last user that opened it for write
- closed it
- - It may also be when the last user that opened it for write and
- actually wrote somthing closed it
- - when the file was last saved
- For a number of systems this information will not be available to an
- unprivileged program.
- Also be aware the for some systems (most classical Unix systems
- included), gathering this information in the obvious manner
- (walk directory and stat'ing every file) may be O(n^2) in the number of
- files in the directory. I have frequently seen cases where time spent
- picking the next file took much longer than processing it.
-