Computing.Net > Forums > Unix > shell script hard links

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shell script hard links

Reply to Message Icon

Name: Destruction
Date: April 14, 2005 at 13:55:28 Pacific
OS: Unix AIX
CPU/Ram: 1 Gig
Comment:

I have a directory old and a directory new. The files in these directories are "hard" linked. When I get newer files...The new files are moved to the old directory and the files in the new directory are replaced with the newer files. However, I need to handle the hard links. The links point at the same physical memory. So shifting with the files from new to old and replacing the newer files with the new files in the new directory will mess up the "hard" links.

Anyone of you have an idea about how to handle this problem and to be sure that the links points to the files they have to point at???

Thanks in advance..And I really hope someone can help me out!

Tony




Sponsored Link
Ads by Google

Response Number 1
Name: Luke Chi
Date: April 17, 2005 at 15:16:33 Pacific
Reply:

Use cp instead of mv.

Example:

cp new_file old_file
cp newest_file new_file

Luke Chi


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: shell script hard links

Unix SHELL SCRIPTS www.computing.net/answers/unix/unix-shell-scripts/4885.html

Shell Scripting Help www.computing.net/answers/unix/shell-scripting-help/5020.html

Identifying Hard Links www.computing.net/answers/unix/identifying-hard-links/3310.html