Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timestamps of directories 1

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
US
Good Day,

I'm looking at a certain directory. It shows -

[appdev@sbkj2kedws01 staging]$ \ls -lt
total 16
drwxr-xr-x 2 appadmin Aug 29 08:28 barrons
drwxr-xr-x 2 appadmin Aug 29 08:28 wsj

Within the barrons and wsj directories, there are files from Sep 12. Shouldn't the file stamp of the parent directory, carry the latest timestamp of its children?

Regards,
Dan
 
Hi Dan,
a directory is only a folder for a LIST of files that are more or less logically related - therefore the NAMES are grouped together in that specific directory. Or in other words: directories are just metadata to make things more organized (no matter where they are physically)
So if you modify a file within a directory then the list of files is still the same (that means the modification time of the directory is not updated).
Cases when a directory modification time will change is when the file list changes:
- if a new file is created "in" that directory.
- if a file is removed "from" that directory or moved "into" another directory.
- if a file "in" that directory is renamed.
(I put the "" around "in" "from" "into" because the directory does not hold the actual data.
HTH,
mrjazz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top