diff --git a/docs/xml/lazutils/lazfileutils.xml b/docs/xml/lazutils/lazfileutils.xml index 63bf1f2cba..ed9b2d391e 100644 --- a/docs/xml/lazutils/lazfileutils.xml +++ b/docs/xml/lazutils/lazfileutils.xml @@ -2603,28 +2603,67 @@ removed. -Creates the specified directories if they do not already exist. +Creates the directories specified in Dir if they do not already exist.

-ForceDirectories is a Boolean function which creates -the specified directories if they do not already exist. ForceDirectories -examines the value in Dir to determine if it contains a Windows device -identifier or a UNC name. If a device identifier or UNC name is found, but -not supported on the platform, no actions are performed in the function. +ForceDirectoriesUTF8 is a Boolean function which creates +any missing directories specified in the UTF-8-encoded Dir argument. +Dir can contain notation using the following conventions: +

+
+
Windows device and path
+
+A disk drive available on the local system, such as 'C:' or 'D:', and directory +names. For example: 'C:\Windows\Fonts'. +
+
Universal Naming Convention identifier
+
+UNC notation like '\\server\share\path\to\dir' (for Windows) or +'//hostname/path/to/dir' (for UNIX-like systems). Please note that UNC support +is not available on all platforms where LCL/LazUtils are hosted. +
+
+Path specification +
+
+A path specification as used on the local file systems For example: +'/path/to/dir' or '\path\to\dir'. Relative paths, like './foo' or '.\foo', are +resolved to the directory where the application executable is located. +
+
+

+ForceDirectoriesUTF8 calls ExtractFileDrive to get the disk or UNC host+share +name used in Dir. No actions are performed if the return value from +ExtractFileDrive is an empty device identifier, or the device does not have a +valid root directory on the local file system. The return value is set to +False.

ForceDirectories raises an EInOutError exception with the message in SCannotCreateEmptyDir when Dir contains an empty string ('').

-Each directory in the specified path is checked using -DirectoryExistsUTF8. ForceDirectories calls -CreateDirUTF8 if a directory does not already exist, and may exit -with a return value of False if directory creation is not successful. +ForceDirectoriesUTF8 converts path delimiters specified in Dir to the value +required for the platform using ForcePathDelims (when needed). +

+

+Each directory found in Dir is checked using DirectoryExistsUTF8. CreateDirUTF8 +is called if a directory does not already exist, and may exit with a return +value of False if directory creation is not successful. +

+

The return value is True if all directories in the path information already exist, or are successfully created in the function.

+ +var bOk: Boolean; +// ... +bOk := ForceDirectoriesUTF8('\\capcom\telemetry\eva\bio'); +bOk := ForceDirectoriesUTF8('//capcom/telemetry/eva/gps'); +bOk := ForceDirectoriesUTF8('/home/jsmith/capcom/telemetry/eva/camera'); +bOk := ForceDirectoriesUTF8('C:\capcom\telemetry\eva\era'); +
@@ -2636,7 +2675,13 @@ SCannotCreateEmptyDir, and ErrorCode is set to 3.
+ + + +ExtractFileDrive +ExtractFilePath +DirectorySeparator
@@ -2646,7 +2691,9 @@ function. -Path information to examine the function. + +Device and path information to examine the function. +