[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

DirectoryIsWritable

Indicates if the specified directory name is writable.

Declaration

Source position: lazfileutils.pas line 42

function DirectoryIsWritable(

  const DirectoryName: string

):Boolean;

Arguments

DirectoryName

  

Directory name to examine in the function.

Function result

True if the specified directory is writable.

Description

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.

Remark: DirectoryIsWritable calls InvalidateFileStateCache with the temporary file name if DeleteFileUTF8 cannot remove the file.

See also

FileCreateUTF8

  

Creates the specified file and returns its file handle.

DeleteFileUTF8

  

Deletes the specified file name.

InvalidateFileStateCache

  

Signals the OnInvalidateFileStateCache event handler.

FileWrite

FileClose


Version 3.2 Generated 2024-02-25 Home