网站首页  词典首页

请输入您要查询的函数:

 

术语 getfiletime
释义 GetFileTime
语法:
C++
BOOL WINAPI GetFileTime(
__in HANDLE hFile,
__out_opt LPFILETIME lpCreationTime,
__out_opt LPFILETIME lpLastAccessTime,
__out_opt LPFILETIME lpLastWriteTime
);
GetFileTime函数
检索的日期和时间,文件或目录的创建,最后一次访问,最后修改。
参数
hFile [in]
句柄的文件或目录的日期和时间要检索。句柄必须已创建使用与GENERIC_READ访问权限CreateFile函数。有关更多信息,请参阅文件安全性和访问权限。
lpCreationTime [指出,可选]
一个FILETIME结构的指针接收的日期和时间的文件或目录已创建。此参数可以是NULL如果应用程序不需要此信息。
lpLastAccessTime [指出,可选]
一个FILETIME结构的指针接收的日期和时间的文件或目录的最后访问。最后访问时间,包括上一次的文件或目录的写入,从,阅读,或在可执行文件的情况下,运行。此参数可以是NULL如果应用程序不需要此信息。
lpLastWriteTime [指出,可选]
一个FILETIME结构的指针接收的日期和时间的文件或目录的最后写入,截断,或覆盖(例如,使用WriteFile或SetEndOfFile)。这个日期和时间没有更新文件属性或更改安全描述符。此参数可以是NULL如果应用程序不需要此信息。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
不是所有的文件系统可以记录创建和最后访问时间,并非所有文件系统记录他们以同样的方式。例如,在FAT,创建时间为10毫秒的决议,写入时间有2秒的决议,存取时间有一天决议(真的,访问日期)。因此,GetFileTime函数可能不返回相同的文件时间信息用SetFileTime设置功能。
NTFS的延迟更新的文件的最后访问时间最多一小时后,最后访问。 NTFS还允许上次访问时间更新被禁用。上次访问时间不更新NTFS卷上的默认。
Windows Server 2003和Windows XP/2000操作系统:最近访问时间更新NTFS卷上的默认。
有关更多信息,请参阅文件倍。
如果您重命名或删除文件,然后还原它不久之后时,Windows搜索的文件信息缓存来恢复。缓存信息包括其短期/长期的名字对,创建时间。
实例
有关示例,请参见检索最后的读写时间。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
文件时报
FILETIME
GetFileSize
GetFileType
SetFileTime
时间函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetFileTime Function
Retrieves the date and time that a file or directory was created, last accessed, and last modified.
Syntax
C++
BOOL WINAPI GetFileTime(
__in HANDLE hFile,
__out_opt LPFILETIME lpCreationTime,
__out_opt LPFILETIME lpLastAccessTime,
__out_opt LPFILETIME lpLastWriteTime
);
Parameters
hFile [in]
A handle to the file or directory for which dates and times are to be retrieved. The handle must have been created using the CreateFile function with the GENERIC_READ access right. For more information, see File Security and Access Rights .
lpCreationTime [out, optional]
A pointer to a FILETIME structure to receive the date and time the file or directory was created. This parameter can be NULL if the application does not require this information.
lpLastAccessTime [out, optional]
A pointer to a FILETIME structure to receive the date and time the file or directory was last accessed. The last access time includes the last time the file or directory 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.
lpLastWriteTime [out, optional]
A pointer to a FILETIME structure to receive the date and time the file or directory was last written to, truncated, or overwritten (for example, with WriteFile or SetEndOfFile ). This date and time is not updated when file attributes or security descriptors are changed. This parameter can be NULL if the application does not require this information.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
Not all file systems can record creation and last access times and not all file systems record them in the same manner. For example, on FAT, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (really, the access date). Therefore, the GetFileTime function may not return the same file time information set using the SetFileTime function.
NTFS delays updates to the last access time for a file by up to one hour after the last access. NTFS also permits last access time updates to be disabled. Last access time is not updated on NTFS volumes by default.
Windows Server 2003 and Windows XP/2000: Last access time is updated on NTFS volumes by default.
For more information, see File Times .
If you rename or delete a file, then restore it shortly thereafter, Windows searches the cache for file information to restore. Cached information includes its short/long name pair and creation time.
Examples
For an example, see Retrieving the Last-Write Time .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
File Times
FILETIME
GetFileSize
GetFileType
SetFileTime
Time Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724320(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:50