[NTLUG:Discuss] changing timestamp on symbolic link?

MadHat madhat at unspecific.com
Wed Mar 12 09:06:55 CST 2003


On Wed, 2003-03-12 at 08:43, Lance Simmons wrote:
> I'd like to change the timestamp on a link (hard or symbolic, I don't
> care which) without changing the timestamp on the target.
> 
> Does anyone know how to do that?  
> 
> If it's impossible, why do symbolic links have timestamps at all?

The timestamp should be the date and time it was created.
If you make any changes to the file, the time stamp on the file will 
be updated.  Remember that there are actually 3 different times logged on 
each file, last modify time, last access time and 'creation' time, but 
isn't going to be when the file was actually created, but when the inode
was last modified, IIRC.  Also depending on the filesystem there may be 
other timestamps associated with a file.  See 'man ls' --time for more info

A symlink is just a pointer to a file and will have its own set of timestamps.
By default ls will show modification time, and you can only modify a symlink,
as far as I know, by deleting it and recreating it or by using the -f, like
'ln -sf this that', which effectively deletes it first anyway.

-- 
MadHat at Unspecific.com
`But I don't want to go among mad people,' Alice remarked.
`Oh, you can't help that,' said the Cat: `we're all mad here...'
   -- Lewis Carroll - _Alice's_Adventures_in_Wonderland_




More information about the Discuss mailing list