如何获取文件放在Windows目录中的日期/时间? [英] How to get date/time when file was placed in a directory on Windows?

查看:606
本文介绍了如何获取文件放在Windows目录中的日期/时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以告诉文件何时被移动到某个目录?

Is there a way to tell when a file was moved to a certain directory?

我被问为什么我的脚本没有找到一个文件某个目录。该文件是去年一月创建的,但我怀疑它在运行脚本后放在目录中。有没有办法确认我的怀疑?

I'm being asked why a script of mine did not find a file in a certain directory. The file was created last January but I suspect it was placed in the directory after the script was run. Is there a way for me to confirm my suspicion?

查看文件属性给我创建,修改和访问的时间,前两个不移动时移动文件从一个目录到另一个目录。

Viewing the file properties gives me the created, modified, and accessed times, and the first two do not change when moving files from one directory to another.

编辑:我安装cygwin,如果这有帮助。是否有unix方式确定目录条目何时创建?

I have cygwin installed, if that helps at all. Is there a unix way of determining when a directory entry was created?

推荐答案

如果有问题的文件可以显示为已经添加到该目录的最后一个文件,您可以查看目录本身的最后修改日期,因为当文件插入到目录中时,目录被修改。否则,我不抱希望。

If the file in question can be shown to have been the last file added to that directory, you can look at the last modified date of the directory itself, since directories are modified when files are inserted into them. Otherwise, I don't hold much hope.

这篇关于如何获取文件放在Windows目录中的日期/时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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