Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Q115】文件系统中 mtime 和 ctime 指什么,都有什么不同 #116

Open
shfshanyue opened this issue Dec 10, 2019 · 1 comment
Open
Labels

Comments

@shfshanyue
Copy link
Owner

@shfshanyue shfshanyue commented Dec 10, 2019

No description provided.

@shfshanyue

This comment has been minimized.

Copy link
Owner Author

@shfshanyue shfshanyue commented Dec 10, 2019

linux 中,

  • mtimemodified time 指文件内容改变的时间戳
  • ctimechange time 指文件属性改变的时间戳,属性包括 mtime。而在 windows 上,它表示的是 creation time

所以 ctime 会比 mtime 要大一些,使用 stat 查看文件属性如下

$ stat hello.txt
  File: ‘hello.txt’
  Size: 30              Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 917526      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-12-10 16:15:55.253325208 +0800
Modify: 2019-12-10 16:15:52.740653330 +0800
Change: 2019-12-10 16:15:52.742653069 +0800
 Birth: -

而 http 服务选择 Last_Modified 时一般会选择 mtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.