The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference between hard link and soft link kamakshi s UNIX for Dummies Questions & Answers 2 06-26-2008 08:05 AM
Hard Link vs SOft Link???? skyineyes UNIX for Dummies Questions & Answers 3 05-29-2008 12:38 PM
hard/soft link question Browser_ice UNIX for Dummies Questions & Answers 1 08-19-2006 02:13 AM
Difference between hard link and soft link in unix RAJACHOKALINGAM UNIX for Dummies Questions & Answers 2 08-01-2006 04:10 AM
Differences between hard link and soft link penguin-friend UNIX for Advanced & Expert Users 3 03-08-2002 03:49 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2008
cdoyle cdoyle is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 4
Can the timestamp of a soft link be changed?

I was wondering if it was at all possible to change the timestamp of a soft link. I want to change it to a time in the past before it was created.

Sceanrio:

In a directory i have a number of softlinks whih point to files, a script processes these files oldest first bassed on the time the softlink was created.

If for example i wanted a certain file to be processed next i would need a way to make the timestamp of the softlink the oldest in the DIR. At the moment the only way i can do this is to remake all the soft links apart from the file i want processed next so all the others have a new timestamp.

This is not ever convient as it then means the remaing files all have the same timestamp and no longer have an order.


I was wondering if there is a way i can update the time of the soft link to make it the oldest in the DIR?

any ideas?
  #2 (permalink)  
Old 08-18-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,391
try touch command go through touch man page
  #3 (permalink)  
Old 08-18-2008
cdoyle cdoyle is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 4
Using Touch only updates the timestamp of the source file. i need to update the time of the soft link.
  #4 (permalink)  
Old 08-18-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Remove and then recreate the symlink.
  #5 (permalink)  
Old 08-18-2008
amsct amsct is offline
Registered User
  
 

Join Date: Aug 2008
Location: Amsterdam, The Netherlands
Posts: 33
On FreeBSD, touch also support 'touching' the link:

man page:
Quote:
-h If the file is a symbolic link, change the times of the link
itself rather than the file that the link points to. Note that
-h implies -c and thus will not create any new files.
  #6 (permalink)  
Old 08-18-2008
cdoyle cdoyle is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 4
Unfortunatly touch on my box does not have a -h option. thanks for the info though. Anyone else got any other ideas?
  #7 (permalink)  
Old 08-19-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,754
Perderabo named the way to do it - for example, in C or perl call unlink() then symlink()
Closed Thread

Bookmarks

Tags
change timestamp, edit timestamp, soft link, softlink

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0