网站首页  词典首页

请输入您要查询的函数:

 

术语 createdirectoryex
释义 CreateDirectoryEx
语法:
C++
BOOL WINAPI CreateDirectoryEx(
__in LPCTSTR lpTemplateDirectory,
__in LPCTSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
CreateDirectoryEx功能
创建一个与指定的模板目录的属性的新目录。如果底层文件系统支持文件和目录的安全性,功能适用于指定的安全描述符到新目录。新目录保留指定的模板目录的其他属性。
作为一个要执行此操作的事务操作,请使用CreateDirectoryTransacted功能。
参数
lpTemplateDirectory [in]
目录的路径,作为在建lx的目录模板。
在此函数的ANSI版本,名称被限制为MAX_PATH字符。为了延长此限制,以32,767宽字符,调用的功能和前面加上“\\ Unicode版本\\?\\”的路径。有关更多信息,请参见命名一个文件。
lpNewDirectory [in]
目录的路径创建。
在此函数的ANSI版本,名称被限制为MAX_PATH字符。为了延长此限制,以32,767宽字符,调用的功能和前面加上“\\ Unicode版本\\?\\”的路径。有关更多信息,请参见命名一个文件。
lpSecurityAttributes [中,可选]
一个SECURITY_ATTRIBUTES结构的指针。结构的lpSecurityDescriptor成员指定一个新的目录安全描述符。
如果lpSecurityAttributes为NULL,则目录得到默认的安全描述。访问控制列表中的一个目录的默认安全描述符(ACL)中都继承自它的父目录。
目标文件系统必须支持此参数有一个安全的影响文件和目录。这表现在GetVolumeInformation返回FS_PERSISTENT_ACLS。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零(0)。为了获得更多错误信息,调用GetLastError。可能的错误包括以下内容。
返回codeDescription
ERROR_ALREADY_EXISTSThe指定的目录已存在。
ERROR_PATH_NOT_FOUNDOne或多个中间目录不存在。这个函数只创建路径中的最后的目录。要创建的道路上所有的中间目录,使用SHCreateDirectoryEx功能。
备注
该CreateDirectoryEx功能允许您创建目录继承流从其他目录的详细信息。此功能非常有用,例如,当您使用Macintosh的目录,都在资源流所需要的正确识别作为一个属性目录内容。
某些文件系统,如NTFS文件系统,支持压缩或个别文件和目录加密。在这样一个文件系统,一个新的目录格式化的卷继承了压缩和它的父目录加密属性。
您可以获取处理与FILE_FLAG_BACKUP_SEMANTICS调用CreateFile函数旗到一个目录设置。有关代码示例,请参见CreateFile。
为了向后兼容的目的,CreateDirectory不适用于Windows 2000的继承规则,当您指定一个lpSecurityAttributes安全描述符。
为了支持在Windows,功能,查询此对象的安全描述符可以启发确定和报告说,当前版本的继承继承生效。有关更多信息,请参阅可继承ACE的自动繁殖。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesCreateDirectoryExW(Unicode)和CreateDirectoryExA(ANSI)的
参见
CreateDirectory
CreateDirectoryTransacted
CreateFile
创建和删除目录
目录管理功能
RemoveDirectory
SECURITY_ATTRIBUTES
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==CreateDirectoryEx Function
Creates a new directory with the attributes of a specified template directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. The new directory retains the other attributes of the specified template directory.
To perform this operation as a transacted operation, use the CreateDirectoryTransacted function.
Syntax
C++
BOOL WINAPI CreateDirectoryEx(
__in LPCTSTR lpTemplateDirectory,
__in LPCTSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
Parameters
lpTemplateDirectory [in]
The path of the directory to use as a template when creating the new 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 .
lpNewDirectory [in]
The path of the directory to be created.
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 .
lpSecurityAttributes [in, optional]
A pointer to a SECURITY_ATTRIBUTES structure. The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory.
If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The access control lists (ACL) in the default security descriptor for a directory are inherited from its parent directory.
The target file system must support security on files and directories for this parameter to have an effect. This is indicated when GetVolumeInformation returns FS_PERSISTENT_ACLS.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero (0). To get extended error information, call GetLastError . Possible errors include the following.
Return codeDescription
ERROR_ALREADY_EXISTSThe specified directory already exists.
ERROR_PATH_NOT_FOUNDOne or more intermediate directories do not exist. This function only creates the final directory in the path. To create all intermediate directories on the path, use the SHCreateDirectoryEx function.

Remarks
The CreateDirectoryEx function allows you to create directories that inherit stream information from other directories. This function is useful, for example, when you are using Macintosh directories, which have a resource stream that is needed to properly identify directory contents as an attribute.
Some file systems, such as the NTFS file system, support compression or encryption for individual files and directories. On volumes formatted for such a file system, a new directory inherits the compression and encryption attributes of its parent directory.
You can obtain a handle to a directory by calling the CreateFile function with the FILE_FLAG_BACKUP_SEMANTICS flag set. For a code example, see CreateFile.
For backward compatibility purposes, CreateDirectory does not apply to Windows 2000 inheritance rules when you specify a security descriptor in lpSecurityAttributes.
To support inheritance on current versions of Windows, functions that query the security descriptor of this object can heuristically determine and report that inheritance is in effect. For more information, see Automatic Propagation of Inheritable ACEs .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesCreateDirectoryExW (Unicode) and CreateDirectoryExA (ANSI)
See Also
CreateDirectory
CreateDirectoryTransacted
CreateFile
Creating and Deleting Directories
Directory Management Functions
RemoveDirectory
SECURITY_ATTRIBUTES
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363856(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 13:24:04