GetDirectoryWriteAccessΒΆ

GetDirectoryWriteAccess checks if the user has write access for the given directory.

nAttrib = GetDirectoryWriteAccess(ssDirectory)

Return Value

nAttib is one of the following values:

Value

Meaning

-1

Directory does not exist or cannot be accessed.

0

The user has only read access.

1

The user has write access.

Parameters

ssDirectory

ssDirectory specifies a complete directory name.

Example

nAttrib = GetDirectoryWriteAccess(ssDirectory);
if (nAttrib == -1) {
    MessageBoxError(_s("The directory \"%s\" does not exist."), ssDirectory);
    return FALSE;
} else if (nAttrib == 0) {
    MessageBoxError(_s("The directory \"%s\" is write protected."), ssDirectory);
    return FALSE;
}

History

Version

Description

5.3.0

New.

id-550782