Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ResUtilCreateDirectoryTree function

Creates every directory specified in a path, skipping directories that already exist. The PRESUTIL_CREATE_DIRECTORY_TREE type defines a pointer to this function.

Syntax


DWORD WINAPI ResUtilCreateDirectoryTree(
  _In_ LPCWSTR pszPath
);

typedef DWORD (WINAPI *PRESUTIL_CREATE_DIRECTORY_TREE)(
    _In_ LPCWSTR pszPath
);

Parameters

pszPath [in]

Pointer to a null-terminated Unicode string specifying a path. The string can end with a trailing backslash.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code.

Remarks

If the path only contains a drive specification (L"c:\\"), ResUtilCreateDirectoryTree will return ERROR_SUCCESS but take no action.

Examples


// BEFORE
//   C:
//   |--Program Files
//      |-- MyApp
//          |--Data
ResUtilCreateDirectoryTree( L"C:\\Program Files\\MyApp\\Startup\\Parameters\\Users" );

ResUtilCreateDirectoryTree( L"C:\\Program Files\\MyApp\\Data\\Archive\\" );

ResUtilCreateDirectoryTree( L"C:\\Program Files\\MyApp\\Bin" );

// This call will return ERROR_SUCCESS even though all directories
// in the path already exist.
ResUtilCreateDirectoryTree( L"C:\\Program Files\\MyApp\\Bin" );

// AFTER
//   C:
//   |--Program Files
//      |--MyApp
//         |--Bin
//         |--Data
//         |  |--Archive
//         |--Startup
//            |--Parameters
//               |--Users
//


Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Enterprise, Windows Server 2008 Datacenter

Header

ResApi.h

Library

ResUtils.lib

DLL

ResUtils.dll

 

 

Show: