C-DEngine 5.105

TheCommonUtils..::..CreateDirectories Method (String)

Creates nested folder hierarchy for a file being created.

Namespace:  nsCDEngine.BaseClasses
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static void CreateDirectories(
	string strFilePath
)
Public Shared Sub CreateDirectories ( _
	strFilePath As String _
)
public:
static void CreateDirectories(
	String^ strFilePath
)

Parameters

strFilePath
Type: String
Path to a folder hierarchy and file to be created.

Remarks


Call this function when you are about to create a file that exists within a folder hierarchy. Include the file name at the end of the path. Example:
C#
// Create "Data" folder
// Create "Data/Current" (or Data\Current) folder
// In preparation for creating file "today.dat"
char sep = Path.DirectorySeparatorChar;
string strDataFile = strDataRoot + sep + "Data" + sep + "Current" + sep + "today.dat";
CreateDirectories(strDataFile);