找出文件修改前的日期时间 [英] Find out the date time before the file has been modified

查看:98
本文介绍了找出文件修改前的日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道是否可以在Java中修改文件之前找到日期时间?我的意思是昨天文件已修改,然后我今天再次修改了文件。如果我使用lastModified()我就可以获得今天的日期时间。那么是否可以获取昨天的日期时间,即修改文件之前文件的日期时间?

May i know is it possible to find out the date time before the file has been modified in Java? I mean the file has modified yesterday, then i modified the file again today. If i use lastModified() i just can get the date time for today. So is it possible to get the date time for yesterday which is the date time of a file before the file has been modified?

推荐答案

修改时间存储为单个文件头中的条目。此信息未缓存;仅记录最新值。记录了几种类型的时间戳,具体取决于操作系统和文件系统。例如,在FAT和NTFS上,分别记录文件创建时间,修改时间和访问时间,具有不同的分辨率。其他文件系统可能只给你修改时间。



更多Microsoft信息可以找到在其中 [ ^ ]。



有没有我知道的文件系统记录这些时间戳的多个值。
Modification time is stored as a single entry in the file header. This information is not cached; only the latest value is recorded. There are several types of timestamp recorded, depending on the operating system and file system. For example, on FAT and NTFS, the file creation time, modification time and access time are separately recorded, with differing resolutions. Other file systems might just give you modification time.

More Microsoft info can be found here[^].

There are no file systems that I am aware of that record multiple values for these timestamps.


这篇关于找出文件修改前的日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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