?
Solved

directory tim stamp

Posted on 2004-05-02
4
Medium Priority
?
330 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 21

Accepted Solution

by:
tfewster earned 80 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 21

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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…
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.
Suggested Courses

850 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