linux下查询文件的创建时间和访问时间

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/NANA170110/article/details/54312889
linux下输入命令行:


stat filename 显示文件状态,包括访问时间,修改时间等。


ls -l filename 显示文件的修改时间(创建时间)


ls -ul filename 显示文件的访问时间(VIM操作时间)


展开阅读全文

怎样用GetFileTime()取得文件创建时间,修改时间访问时间??

02-01

LPFILETIME lpCreationTimernLPFILETIME lpLastAccessTime rnLPFILETIME lpLastWriteTime rnrn已知文件的绝对路径 eg.c:\abc.txt ,请把这个文件的三个时间属性以类似于“年月日时分秒”--- 即20020201000000 的形式写到Edit1,Edit2,Edit3中!rnrn每个30分!决不食言!rnrn注:API说明rnrnGetFileTimernrnThis function retrieves the date and time that a file was created, last accessed, and last modified. A remote application interface (RAPI) version of this function exists, and it is named CeGetFileTime.rnrnBOOL GetFileTime( rnHANDLE hFile, rnLPFILETIME lpCreationTime, rnLPFILETIME lpLastAccessTime, rnLPFILETIME lpLastWriteTime ); rnParametersrnhFile rn[in] Handle to the files for which to get dates and times. The file handle must have been created with GENERIC_READ access to the file. rnlpCreationTime rn[out] Pointer to a FILETIME structure to receive the date and time the file was created. This parameter can be NULL if the application does not require this information. rnlpLastAccessTime rn[out] Pointer to a FILETIME structure to receive the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or, in the case of executable files, run. This parameter can be NULL if the application does not require this information. rnlpLastWriteTime rn[out] Pointer to a FILETIME structure to receive the date and time the file was last written to. This parameter can be NULL if the application does not require this information. rnrnrnrnrn 论坛

没有更多推荐了,返回首页