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
  • Modifying the date and time associated with a file
  • Handling errors
  • Operating mode in the different operating systems
  • Operating mode in Windows Vista (and later)
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 different dates associated with a file or directory (date created, modified or accessed).
Reportes y Consultas
// Retrieve the modification date of a file
ResDate = fDate("C:\MyDirectories\File.txt", "", fModify)
Sintaxis
<Result> = fDate(<File or directory path> [, <New date> [, <Type of date>]])
<Result>: Character string
  • Date associated with the file or directory (in YYYYMMDD format),
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<File or directory path>: Character string
  • Name and full (or relative) path of the file (up to 260 characters).
  • Full (or relative) path of directory (up to 260 characters). If this parameter corresponds to a directory name, this name may (or may not) end with "\".
    A UNC path can be used.
<New date>: Optional character string
  • Date modification: new file/directory date (in YYYYMMDD format).
  • Reading a date: empty string ("").
<Type of date>: Optional constant
Indicates the date to handle:
fAccessDate of last access to the file or directory.
fCreationCreation date of the file or directory.
fModify
(Default value)
Date of the last modification made to a file or directory.

Observaciones

Modifying the date and time associated with a file

To modify the date and time associated with a file, you have the ability to use fDateTime.
Note: It is also possible to use the fDate and fTime functions in succession.. However, fDateTime is faster.

Handling errors

fDate throws an error in the following cases:
  • the specified file is opened or the file is locked by another application,
  • the specified file or directory does not exist,
  • the name of the specified file is invalid,
  • the year of one of the file dates is before 1980 (or 1970 in Java),
  • the format of <New date> is incorrect.
  • ...

Operating mode in the different operating systems

  • The date of a file or directory cannot be modified under the following systems: Windows 98, Windows ME.
Reportes y Consultas

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).
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