Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: why does open ">..." sometimes touches the directory?

by flexvault (Parson)
on Feb 05, 2013 at 09:27 UTC ( #1017089=note: print w/ replies, xml ) Need Help??


in reply to why does open ">..." sometimes touches the directory?

Hello Mark_Galeck,

Since you're on Linux, what you are seeing is "normal". Occasionally I get interrupted and forget where I put a file, I can go to the head of the file system and follow the updated directories to locate the file. ( Hint: all directories are 'touch'ed, and on a very active system this technique may not work. ) When installing your *nix, you can turn this feature off to get better performance. Usually flash drives and Live CD/DVDs are build this way.

If you have administrative rights you can use the 'ln -s' command to bypass how you access the file, for example:

/home/mark/bin/myscript ## This file exists ln -s /home/mark/bin /mark ## /mark is symbolic link to /home +/mark/bin touch /mark/myscript ## change timestamp on directories + to myscript

The actual directories to 'myscript' will have their timestamps updated, but the symbolic link '/mark' will not change. ( If that is what you want ).

However as a system admin, I would be very concerned about 'end users' not wanting to show that they added/updated a file.

Good Luck...Ed

Update: This tested correctly on AIX, but after reading dave_the_m comments, I tried it on a "debian" and a "suse" systems with mixed results.

"Well done is better than well said." - Benjamin Franklin


Comment on Re: why does open ">..." sometimes touches the directory?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-08-20 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (111 votes), past polls