PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Identifying the attributes of a directory
  • Modifying the attributes of a directory (syntax 2)
  • Managing the errors
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
fDirAttribute (Function)
In french: fRepAttribut
Returns or modifies the attributes of a directory.
PHP In this version, you can only find out the attributes of a directory.
Example
WEBDEV - Server codePHPAjax
// Retrieve the attributes of a directory
ResAttribute = fDirAttribute("C:\MyDirectories")
IF ResAttribute <> "ERR" THEN
...
END
Syntax

Retrieving the attributes of a directory Hide the details

<Result> = fDirAttribute(<Directory path>)
<Result>: Character string
  • "ERR" if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
  • One or more letters corresponding to the attributes of the directory ("AH" for example).
    The following letters are used:
    • R: Read-only directory. The directory can be accessed in read-only.
    • H: Hidden directory. The name of the directory is grayed or not visible in the explorer.
      PHP This value is not available.
    • S: System directory. The directory is a system directory of Windows.
      PHP This value is not supported.
    • A: "Archive" directory. This attribute indicates that the directory can be archived. Some programs use this attribute to find out which directories have been saved.
      LinuxPHP This value is not supported.
    • D: Directory or sub-directory. The directory is a directory or a sub-directory.
    • C: Compressed directory (on NTFS partitions). The directory was automatically compressed when it was copied onto an NTFS partition (Windows NT or 2000).
      PHP This value is not supported.
<Directory path>: Character string (with quotes)
Name and full (or relative) path of directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
PHP The access to the network drives depends on the rights defined for the user of the Web server.
WEBDEV - Server codePHP

Modifying the attributes of a directory Hide the details

<Result> = fDirAttribute(<Directory path> , <Directory attributes>)
<Result>: Character string
  • "ERR" if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
  • One or more letters corresponding to the new attributes of directory ("AH" for example),
    The following letters are used:
    • R: Read-only directory. The directory can be accessed in read-only.
    • H: Hidden directory. The name of the directory is grayed or not visible in the explorer.
    • S: System directory. The directory is a system directory of Windows.
    • A: "Archive" directory. This attribute indicates that the directory can be archived. Some programs use this attribute to find out which directories have been saved.
    • D: Directory or sub-directory. The directory is a directory or a sub-directory.
    • C: Compressed directory (on NTFS partitions). The directory was automatically compressed when it was copied onto an NTFS partition (Windows NT or 2000).
<Directory path>: Character string (with quotes)
Name and full (or relative) path of directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
PHP The access to the network drives depends on the rights defined for the user of the Web server.
<Directory attributes>: Character string (with quotes)
One or more letters corresponding to the new attributes of specified directory ("AH" for example). The order of the letters has no importance. The following letters are used:
  • R: Read-only directory. The directory can be accessed in read-only.
  • H: Hidden directory. The name of the directory is grayed or not visible in the explorer.
  • S: System directory. The directory is a system directory of Windows.
  • To: "Archive" directory. This attribute indicates that the directory can be archived. Some programs use this attribute to find out which directories have been saved.
PHP Only the "R" attribute can be modified (read-only/read-write).
Remarks

Identifying the attributes of a directory

To find out the different attributes of a directory, check whether one of the letters identifying an attribute is found in <Result>. This search can be performed by Position for example.
WEBDEV - Server codePHPAjaxStored procedures

Modifying the attributes of a directory (syntax 2)

After modification, the attributes of the directory correspond to the attributes specified by fDirAttribute. For example, if <Directory attributes> is set to "AR", the specified directory will become a read-only archive directory.
Special cases:
  • Modifying directory or a sub-directory: The "Directory or sub-directory" attribute (letter D) cannot be modified. Regardless of the modification performed, the directory (or the sub-directory) will keep the "Directory and sub-directory" attribute (letter D).
  • Modifying a compressed directory (on the NTFS partitions): The "Compressed directory" attribute (letter C) cannot be modified. Regardless of the modification performed, the compressed directory will keep the "Compressed directory" attribute (letter C).

Managing the errors

fDirAttribute generates an error in the following cases:
  • the specified directory does not exist,
  • the name of the directory is invalid,
  • the directory is locked by another application (only when attributes are modified),
  • the letters specified in <Directory attributes> do not correspond to directory attributes.
WEBDEV - Server codePHP

Operating mode in Windows Vista (and later)

If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
Indeed, in Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have the administrator privileges to handle and/or modify the files or directories in the system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
  • avoid writing into the Windows directory or into the "Program Files" directory,
  • use the system directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant).
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment