网站首页  词典首页

请输入您要查询的函数:

 

术语 getfileattributesex
释义 GetFileAttributesEx
语法:
C++
BOOL WINAPI GetFileAttributesEx(
__in LPCTSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation
);
GetFileAttributesEx功能
检索属性指定的文件或目录。
作为一个要执行此操作的事务操作,请使用GetFileAttributesTransacted功能。
参数
lpFileName [in]
该文件或目录名称。
在此函数的ANSI版本,名称被限制为MAX_PATH字符。为了延长此限制,以32,767宽字符,调用的功能和前面加上“\\ Unicode版本\\?\\”的路径。有关更多信息,请参见命名一个文件。
fInfoLevelId [in]
一个属性信息类检索。
此参数可从GET_FILEEX_INFO_LEVELS枚举以下值。
ValueMeaning
GetFileExInfoStandardThe lpFileInformation参数是一个WIN32_FILE_ATTRIBUTE_DATA结构。
lpFileInformation [out]
阿一个缓冲区,它接收属性信息的指针。
该类型的属性信息是这个缓冲区存储的是由fInfoLevelId值确定。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零(0)。为了获得更多错误信息,调用GetLastError。
备注
GetFileAttributes函数检索的文件系统的属性信息。 GetFileAttributesEx可以取得文件或目录的属性信息等集。目前,GetFileAttributesEx检索的标准属性集这是文件系统的属性信息的超集。
当GetFileAttributesEx函数是一个目录,是一个安装文件夹,调用时,它返回目录属性,而不是在卷的根目录那些与安装文件夹目录联系。要获取相关的卷的属性,调用GetVolumeNameForVolumeMountPoint以获得相关的卷名。然后用在给GetFileAttributesEx电话所产生的名称。结果对相关卷的根目录的属性。
符号链接的行为,如果路径指向一个符号链接,该函数返回的符号链接属性。
交易业务
如果打开一个文件进行修改的交易,没有其他线程可以打开文件进行修改,直到提交事务。因此,如果一个事务处理线程打开文件的第一,任何试图修改前的事务被提交文件的后续线程收到共享冲突。如果非交易线程修改线程交易之前,该文件不,该文件仍处于打开状态时,交易试图打开它,交易收到错误ERROR_TRANSACTIONAL_CONFLICT。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetFileAttributesExW(Unicode)和GetFileAttributesExA(ANSI)的
参见
文件属性
文件管理函数
GetFileAttributes
GetFileAttributesTransacted
SetFileAttributes
符号链接
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetFileAttributesEx Function
Retrieves attributes for a specified file or directory.
To perform this operation as a transacted operation, use the GetFileAttributesTransacted function.
Syntax
C++
BOOL WINAPI GetFileAttributesEx(
__in LPCTSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation
);
Parameters
lpFileName [in]
The name of the file or directory.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\\\?\\" to the path. For more information, see Naming a File .
fInfoLevelId [in]
A class of attribute information to retrieve.
This parameter can be the following value from the GET_FILEEX_INFO_LEVELS enumeration.
ValueMeaning
GetFileExInfoStandardThe lpFileInformation parameter is a WIN32_FILE_ATTRIBUTE_DATA structure.

lpFileInformation [out]
A pointer to a buffer that receives the attribute information.
The type of attribute information that is stored into this buffer is determined by the value of fInfoLevelId.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero (0). To get extended error information, call GetLastError .
Remarks
The GetFileAttributes function retrieves file system attribute information. GetFileAttributesEx can obtain other sets of file or directory attribute information. Currently, GetFileAttributesEx retrieves a set of standard attributes that is a superset of the file system attribute information.
When the GetFileAttributesEx function is called on a directory that is a mounted folder, it returns the attributes of the directory, not those of the root directory in the volume that the mounted folder associates with the directory. To obtain the attributes of the associated volume, call GetVolumeNameForVolumeMountPoint to obtain the name of the associated volume. Then use the resulting name in a call to GetFileAttributesEx. The results are the attributes of the root directory on the associated volume.
Symbolic link behavior—If the path points to a symbolic link, the function returns attributes for the symbolic link.
Transacted Operations
If a file is open for modification in a transaction, no other thread can open the file for modification until the transaction is committed. So if a transacted thread opens the file first, any subsequent threads that try modifying the file before the transaction is committed receives a sharing violation. If a non-transacted thread modifies the file before the transacted thread does, and the file is still open when the transaction attempts to open it, the transaction receives the error ERROR_TRANSACTIONAL_CONFLICT.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetFileAttributesExW (Unicode) and GetFileAttributesExA (ANSI)
See Also
File Attributes
File Management Functions
GetFileAttributes
GetFileAttributesTransacted
SetFileAttributes
Symbolic Links
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364946(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:25:14