Solved

directory tim stamp

Posted on 2004-05-02
4
318 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now