UNIX 目录何时更改其时间戳 [英] When does a UNIX directory change its timestamp

查看:43
本文介绍了UNIX 目录何时更改其时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文件上使用了touch",更新了文件的时间戳,但父目录的时间戳没有改变.但是,(正如预期的那样)当我在父目录中创建一个新文件时,该目录的时间戳确实发生了变化.

I used "touch" on a file, updating the file's timestamp but the parent directory's timestamp did not change. However, (as expected) when I created a new file within the parent directory, the directory's timestamp did change.

类 UNIX 操作系统(特别是 AIX)使用什么标准来确定何时更新目录的时间戳?

What criteria do UNIX-like operating systems (specifically AIX) use to determine when to update the timestamp of a directory?

推荐答案

当代表目录的数据发生变化时,时间戳会更新.目录 D 的子目录中的更改不会更改 D 表示中的任何内容,因为 D 仅指向子目录,而不指向其中的内容.另一方面,在 D 中创建文件会更改磁盘上代表 D 的数据块.

The timestamp is updated when the data that represents the directory changes. A change in a subdirectory of directory D does not change anything in the representation of D because D only points to the subdirectory, not to what's inside it. On the other hand, creating a file in D changes the block of data on disk that represents D.

这篇关于UNIX 目录何时更改其时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆