DirectoryIsWritable function
Indicates if the specified directory name is writable.
Declaration
function DirectoryIsWritable(const DirectoryName: string): BooleanDescription
DirectoryIsWritable is a
Boolean function used to
determine if the specified directory name is writable in the file system. The
path name in DirectoryName must already exist on the local file system. The
return value is
False if a directory with the specified name does not
exist.
The return value is True when a file can be added, deleted, or modified in the specified path. To get the return value, DirectoryIsWritable creates a temporary file in DirectoryName, adds content to it, and deletes the temporary file. DirectoryIsWritable calls the FileCreateUTF8, FileWrite, FileClose, and DeleteFileUTF8 routines to perform the file operations. The return value is True when FileWrite completes successfully.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
