ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Identifying the attributes of a directory
  • Modifying the attributes of a directory (syntax 2)
  • Handling errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns or modifies the attributes of a directory.
Android In this version, you can only find out the attributes of a directory.
Example
Syntax

Retrieving the attributes of a directory Hide the details

<Result> = fDirAttribute(<Directory path>)
<Result>: Character string
  • "ERR" if an error occurred. To get more details on the error, use ErrorInfo 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.
    • S: System directory. The directory is a system directory of Windows.
      AndroidAndroid Widget 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.
      AndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst This value is not supported.
    • D: Directory or subdirectory. The directory is a directory or a subdirectory.
    • C: Compressed directory (on NTFS partitions). The directory was automatically compressed when it was copied onto an NTFS partition (Windows NT or 2000).
      AndroidAndroid Widget This value is not supported.
<Directory path>: Character string
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 "\".
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories.
iPhone/iPadIOS WidgetMac Catalyst

Modifying the attributes of a directory Hide the details

<Result> = fDirAttribute(<Directory path> , <Directory attributes>)
<Result>: Character string
  • "ERR" if an error occurred. To get more details on the error, use ErrorInfo 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 subdirectory. The directory is a directory or a subdirectory.
    • 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
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 "\".
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories.
<Directory attributes>: Character string
One or more letters corresponding to the new attributes of the 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.
  • 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.
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.
Stored procedures

Modifying the attributes of a directory (syntax 2)

Once modified, the attributes of the directory correspond to the attributes specified with 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 subdirectory: The "Directory or subdirectory" attribute (letter D) cannot be modified. Regardless of the modification performed, the directory (or the subdirectory) will keep the "Directory and subdirectory" 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).

Handling errors

fDirAttribute throws 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.
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/23/2022

Send a report | Local help