java 文件访问时间_打开文件后,访问时间不会更改

我使用stat来获取文件的访问时间(当前日期是2013年10月23日)

[juan@JN-LNXSVR-02 labfiles]$ stat nursery

File: `nursery'

Size: 837 Blocks: 8 IO Block: 4096 regular file

Device: fd00h/64768d Inode: 139539 Links: 1

Access: (0644/-rw-r--r--) Uid: ( 500/ juan) Gid: ( 500/ juan)

Access: 2013-10-22 18:03:20.703888346 -0400

Modify: 2013-10-21 16:57:07.801165793 -0400

然后我编辑文件并关闭它而不做任何修改,然后再次提交stat

juan@JN-LNXSVR-02 labfiles]$ vi nursery

[juan@JN-LNXSVR-02 labfiles]$ stat nursery

File: `nursery'

Size: 837 Blocks: 8 IO Block: 4096 regular file

Device: fd00h/64768d Inode: 139539 Links: 1

Access: (0644/-rw-r--r--) Uid: ( 500/ juan) Gid: ( 500/ juan)

Access: 2013-10-22 18:03:20.703888346 -0400

Modify: 2013-10-21 16:57:07.801165793 -0400

Change: 2013-10-21 16:57:07.801165793 -0400

但访问时间没有变化,为什么?

我找不到任何noatime属性

juan@JN-LNXSVR-02 labfiles]$ grep noatime /proc/mounts

[juan@JN-LNXSVR-02 labfiles]$

mount命令的输出是

[juan@JN-LNXSVR-02 labfiles]$ mount

/dev/mapper/vg_jnlnxsvr02-lv_root on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda1 on /boot type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

[juan@JN-LNXSVR-02 labfiles]$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值