PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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.
AndroidJavaPHP In this version, you can only find out the attributes of a directory.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPAjaxUser code (UMC)
// Retrieve the attributes of a directory
ResAttribute = fDirAttribute("C:\MyDirectories")
IF ResAttribute <> "ERR" THEN
...
END
Windows Mobile
// Retrieve the attributes of a directory
ResAttribute = fDirAttribute("\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.
      AndroidAndroid Widget JavaPHP 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.
      LinuxAndroidAndroid Widget iPhone/iPadJavaPHP 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).
      AndroidAndroid Widget JavaPHP 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.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
Versions 17 and later
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
New in version 17
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
PHP The access to the network drives depends on the rights defined for the user of the Web server.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobilePHPUser code (UMC)

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.
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
Versions 17 and later
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
New in version 17
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories.
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.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobilePHPAjaxUser code (UMC)Stored procedures

Modifying the attributes of a directory (syntax 2)

After modification, the attributes of the directory correspond to the attributes specified by fAttribute. 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.
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not operate properly in Windows Vista (and later), check whether the file used is not found 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 found in the system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files without having 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).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment