.. highlightlang:: us .. index:: GetDirectoryWriteAccess .. _getdirectorywriteaccess: GetDirectoryWriteAccess ======================= .. us.tag GetDirectoryWriteAccess ENGLISH FILE_MISC New530 :ref:`GetDirectoryWriteAccess` checks if the user has write access for the given directory. .. function:: nAttrib = GetDirectoryWriteAccess(ssDirectory) .. us.return **Return Value** *nAttib* is one of the following values: .. list-table:: :header-rows: 1 * - Value - Meaning * - -1 - Directory does not exist or cannot be accessed. * - 0 - The user has only read access. * - 1 - The user has write access. .. us.params **Parameters** .. uparam:: ssDirectory *ssDirectory* specifies a complete directory name. .. us.example **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; } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.3.0 - New. .. seealso:: :ref:`overview-files`, :ref:`FindFiles`, :ref:`SetFileAttributes`, :ref:`GetFileWriteAccess` :sub:`id-550782`