Zsh Mailing List Archive
Messages sorted by:
Re: Extract CTIME in zsh 4.2.3?
- X-seq: zsh-users 9339
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Shawn Halpenny <paxunix@xxxxxxxxx>
- Subject: Re: Extract CTIME in zsh 4.2.3?
- Date: Mon, 22 Aug 2005 17:35:29 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <44613de005082208246036665e@xxxxxxxxxxxxxx>
- Mail-followup-to: Shawn Halpenny <paxunix@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
- References: <95E667D6-6AE4-4CDA-B420-30033315C886@xxxxxxxxxxxx> <44613de005082113114c9f2092@xxxxxxxxxxxxxx> <16D53E3C-D453-414D-AB6C-3280FF5573CF@xxxxxxxxxxxx> <44613de005082208246036665e@xxxxxxxxxxxxxx>
Hi Shawn and Timothy :)
* Shawn Halpenny <paxunix@xxxxxxxxx> dixit:
> On 8/22/05, Timothy Luoma <lists@xxxxxxxxxxxx> wrote:
> > I've found a solution, but this will only work with Tiger (Mac OS X
> > version 10.4.x)...
> Ahh, it wasn't clear you wanted the create-time. In Unix (and any
> sufficiently Unix-like operating system) the "ctime" for a file is the
> last time there was a change to the file's inode and is generally
> portable. Not all Unixes keep track of the create-time for a file, so
> any mechanism to retrieve it is almost certainly non-portable.
In fact, it is not present in SUS. Probably it is present only
for a few filesystems, so it has to be retrieved in a non-portable
way. Under Linux, I don't recall now of any filesystem that
implements creation time for entries. It's not an operating system
problem, is a filesystem problem. Even in the case you can write
code for some UNIX flavour to retrieve that data, it will only work
for some particular filesystem. The VFS on top of that will only
store the st_atime, st_mtime and st_ctime values in the metadata.
Another solution will be to create a dotfile or something like
that when creating the file whose creation date you want to obtain,
and make sure the file contents of that dotfile (or associated file,
whatever you call it) doesn't change. Then the st_mtime of the
associated file will be the creation time of the 'real' file. Not a
very clean solution, but...
Raúl Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...
Messages sorted by: