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
  • Managing the seconds
  • Handling errors
  • Operating mode in Windows Vista (and later)
  • Operating mode in the different operating systems
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 times associated with a file or directory (date created, modified or accessed).
PHP In this version, you cannot find out or modify the creation time of a file or directory.
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)PHPAjax
// Retrieve the modification time of a file
ResTime = fTime("C:\MyDirectories\File.txt", "", fModify)
Sintaxis
<Result> = fTime(<File or directory path> [, <New time> [, <Type of time>]])
<Result>: Character string
  • Time associated with the file or directory (in HHMMSS format),
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
<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).
A UNC path can be used. If this parameter corresponds to a directory name, this 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: On iPhone or iPad, an application has the rights to write to its installation directory or one of its subdirectories
<New time>: Optional character string
  • Modification of a time: new time for the specified file or directory (in HHMMSS format),
  • Time reading: empty string ("").
<Type of time>: Optional constant
Indicates the time to use:
fAccessTime of last access to the file or directory.
AndroidWidget Android Java This constant is not available.
fCreationTime of file/directory creation.
AndroidWidget Android JavaPHP This constant is not available.
fModify
(Default value)
Time of last modification made to the file or directory.
Observaciones
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android Código de Usuario (UMC)AjaxProcedimientos almacenados

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 fDate and fTimefunctions in succession. . However, fDateTime is faster.

Managing the seconds

All the methods for disk formatting (FAT, NTSF, ...) are not precise to the second. Depending on the method used, fTime may round the time passed as parameter
For example, for a FAT drive, the time for file access has a precision of one day. Therefore, the access time is "000000" and it cannot be modified.

Handling errors

fTime throws an error in the following cases:
  • the specified file is opened or locked by another application,
  • the specified file does not exist,
  • the name of the specified file is invalid,
  • the format of <New time> is incorrect. A WLanguage error occurs if the format of <New time> is incorrect.
  • a Unicode string was used for <Path of file or directory> in an operating system such as Windows 98 or Windows Me.
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)

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

Operating mode in the different operating systems

  • The time of a file or directory cannot be modified under the following systems: Windows 98, Windows ME.
  • PHP You cannot find out or modify the creation time associated with a file or with a directory.
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