Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

directory tim stamp

Posted on 2004-05-02
4
321 Views
Last Modified: 2013-12-06
under what circumstance, the timestamp of the directory will be changed?
the file inside got delete/modify/create?
thanks!
0
Comment
Question by:jackie190
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 10971918
The timestamp on a directory will change anytime there is a change in the contents of that directory. Obviously, adding/removing files would change the contents, but not so obviously a simple edit of a file will also change the timestamp.
0
 
LVL 20

Accepted Solution

by:
tfewster earned 20 total points
ID: 10972222
Hmm, I disagree that editing an existing file will change the directory timestamp;  The timestamp of the file is held in the files inode. The directory is just a list of inodes and the names associated with those inodes, so I can't see why it would change.

I suppose it could be different for different filesystem types, e.g. if the file grew past a block boundary and the directory referenced the additional blocks/inodes directly.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 10972247
I can't say if it "should" change the timestamp as a result of a simple edit, but my statement was based on a direct test. A simple edit did change the timestamp on the directory.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 10972672
jlevie, I don't doubt your word (and I should have guessed that you would test it to ensure your answer was 100% accurate ;-)   What Unix/Filesystem type did you try it on?  Your setup might be more relevant to jackie190's situation than mine...

I ran some tests on HP-UX 11.0 HFS & VXFS filesystems, plus AIX 4.3 (Veritas based?) and Solaris 8 (I think that machine is all UFS filesystems, but I forgot to check) and a "trivial" edit  such as adding a space or blank line didn't change the directory timestamp.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sort command HPUX 11 81
Hyper-threading config in Solaris 6 167
SCP a file to multiple machines using a script 4 66
Expiration and Locking of Unix/Solaris OS Accounts 7 49
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question