AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Identifying the attributes of a directory
  • Modifying the attributes of a directory (syntax 2)
  • Handling errors
  • Operating mode in Windows Vista (and later)
  • Previous versions
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Returns or modifies the attributes of a directory.
AndroidJavaPHP In this version, you can only find out the attributes of a directory.
Ejemplo
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)PHPAjax
// Retrieve the attributes of a directory
ResAttribute = fDirAttribute("C:\MyDirectories")
IF ResAttribute <> "ERR" THEN
	...
END
Sintaxis

Retrieving the attributes of a directory Ocultar los detalles

<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.
      PHP This value is not available.
    • S System directory. The directory is a system directory of Windows.
      AndroidWidget Android 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.
      LinuxAndroidWidget Android iPhone/iPadIOS WidgetMac CatalystJavaPHP This value is not supported.
    • D: Directory or sub-directory. 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).
      AndroidWidget Android JavaPHP 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 "\".
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidWidget Android 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 installation 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 Under iPhone/iPad, on both the device and the emulator, the file system is read-only. An application can only write to its installation directory or one of its subdirectories.
PHP The access to the network drives depends on the rights defined for the user of the Web server.
WINDEVWEBDEV - Código ServidorReportes y ConsultasiPhone/iPadIOS WidgetMac CatalystCódigo de Usuario (UMC)PHP

Modifying the attributes of a directory Ocultar los detalles

<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 sub-directory. 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 "\".
WindowsLinux This parameter can be in Ansi or Unicode format.
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 Under iPhone/iPad, on both the device and the emulator, the file system is read-only. An application can only write to its installation directory or one of its subdirectories.
PHP The access to the network drives depends on the rights defined for the user of the Web server.
<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.
PHP Only the "R" attribute can be modified (read-only/read-write).
Observaciones

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 - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)PHPAjaxProcedimientos almacenados

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.
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)PHP

Operating mode in Windows Vista (and later)

If this function does not work 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).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: If you need to manipulate / modify files or directories, without needing administrator privileges, it is advisable:
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
WINDEV

Previous versions

This function replaces fDirAttrib, which is kept for compatibility with WINDEV 5.5.
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local