网站首页  词典首页

请输入您要查询的函数:

 

术语 getfilesize
释义 GetFileSize
语法:
C++
DWORD WINAPI GetFileSize(
__in HANDLE hFile,
__out_opt LPDWORD lpFileSizeHigh
);
GetFileSize函数
检索指定文件的大小,以字节为单位。
我们建议您使用GetFileSizeEx。
参数
hFile [in]
阿处理该文件。
lpFileSizeHigh [指出,可选]
一个地方高文件的大小顺序双字是返回的变量的指针。此参数可以是NULL如果应用程序不要求高阶双字。
返回值
如果函数成功,返回值是低文件的大小顺序双字,并且,如果lpFileSizeHigh不为NULL,函数变量放进高文件的大小为双字指向该参数。
如果函数失败并lpFileSizeHigh为NULL,则返回值为INVALID_FILE_SIZE。为了获得更多错误信息,调用GetLastError。当lpFileSizeHigh为NULL,大文件产生的结果是含糊不清,您将无法确定文件的实际大小。我们建议您使用GetFileSizeEx代替。
如果函数失败和lpFileSizeHigh不为NULL,则返回值为INVALID_FILE_SIZE和GetLastError函数返回一个值比NO_ERROR等。
备注
您不能使用一个nonseeking设备句柄,如管道或通信设备GetFileSize功能。要确定hFile文件类型,使用GetFileType功能。
该GetFileSize函数检索文件的压缩大小。使用GetCompressedFileSize函数来获得一个文件的压缩后的大小。
请注意,如果返回值是INVALID_FILE_SIZE(0xffffffff)的,应用程序必须调用GetLastError,以确定是否该函数是成功还是失败。该函数的原因,可能会出现失败的时候也没有,是lpFileSizeHigh可以是非NULL或文件的大小可以为0xffffffff。在这种情况下,GetLastError函数将返回NO_ERROR(0后成功)。由于这种行为,建议您使用GetFileSizeEx代替。
交易操作:如果没有绑定到文件处理事务,那么该函数返回的孤立文件视图的信息。
实例
有关示例,请参见创建在一个文件视图。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
文件管理函数
GetCompressedFileSize
GetFileSizeEx
GetFileType
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetFileSize Function
Retrieves the size of the specified file, in bytes.
It is recommended that you use GetFileSizeEx .
Syntax
C++
DWORD WINAPI GetFileSize(
__in HANDLE hFile,
__out_opt LPDWORD lpFileSizeHigh
);
Parameters
hFile [in]
A handle to the file.
lpFileSizeHigh [out, optional]
A pointer to the variable where the high-order doubleword of the file size is returned. This parameter can be NULL if the application does not require the high-order doubleword.
Return Value
If the function succeeds, the return value is the low-order doubleword of the file size, and, if lpFileSizeHigh is non-NULL, the function puts the high-order doubleword of the file size into the variable pointed to by that parameter.
If the function fails and lpFileSizeHigh is NULL, the return value is INVALID_FILE_SIZE. To get extended error information, call GetLastError . When lpFileSizeHigh is NULL, the results returned for large files are ambiguous, and you will not be able to determine the actual size of the file. It is recommended that you use GetFileSizeEx instead.
If the function fails and lpFileSizeHigh is non-NULL, the return value is INVALID_FILE_SIZE and GetLastError will return a value other than NO_ERROR.
Remarks
You cannot use the GetFileSize function with a handle of a nonseeking device such as a pipe or a communications device. To determine the file type for hFile, use the GetFileType function.
The GetFileSize function retrieves the uncompressed size of a file. Use the GetCompressedFileSize function to obtain the compressed size of a file.
Note that if the return value is INVALID_FILE_SIZE (0xffffffff), an application must call GetLastError to determine whether the function has succeeded or failed. The reason the function may appear to fail when it has not is that lpFileSizeHigh could be non-NULL or the file size could be 0xffffffff. In this case, GetLastError will return NO_ERROR (0) upon success. Because of this behavior, it is recommended that you use GetFileSizeEx instead.
Transacted Operations: If there is a transaction bound to the file handle, then the function returns information for the isolated file view.
Examples
For an example, see Creating a View Within a File .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
File Management Functions
GetCompressedFileSize
GetFileSizeEx
GetFileType
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364955(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:24:32