Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by flexvault (Prior)
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 chilling in the Monastery: (6)
As of 2015-07-06 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls