I am looking for a list of actions that can performed that will result in a directories modification time being updated. Off the top of my head:
- Create a new file in the directory
- Delete a file in the directory
What am I missing?
|
I am looking for a list of actions that can performed that will result in a directories modification time being updated. Off the top of my head:
What am I missing?
| |||
|
feedback
|
|
In Linux (in most Unices, in fact), directories are like files containing simple tables that look like: inode name +-----+-----------+ | 3 | bin | | 12 | home | | 139 | usr | | ... | ... | +-----+-----------+ So, these "files" (directories) are changed when you make changes to this table. It changes when you add or remove entries from that table (like you noted), but that applies to directories too, not only files. You can't change the inode of an existing entry, but you can change the name that links to that inode (rename a file). So:
These are the operations that changes the modification time of a directory. | |||||
feedback
|
|
You can 'touch' the directory to update the date/time of it as well, without changing contents. | |||
|
feedback
|
|
At a macro level, there is one interesting observation. When you use certain tools that tend to make a temporary file in the local directory (instead of /tmp), and these files are usually hidden (starting with a One such case is when you open a file in Nothing wrong with this, but helps to know what happened. And, if you are bothered with that, there is a way to stop it too. | |||||
feedback
|