AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Example: Retrieving the different times associated with a file
  • Example: Modifying the time of file creation
  • Example: Retrieving the different times associated with a file (WEBDEV)
  • Example: Modifying the modification time of a file (WEBDEV)
Example: Retrieving the different times associated with a file
WINDEVReportes y ConsultasCódigo de Usuario (UMC) The following code is used to find out the different times associated with a file. The file is selected by fSelect.
// Declare the variables
ResCreationTime is string
ResModificationTime is string
ResAccessTime is string
FilePath is string
 
// Select a file
FilePath = fSelect("", "", "Selecting a file", ...
"All files (*.*)" + TAB + "*.*", "", fselOpen + fselExist)
 
// Retrieve the file time information
ResCreationTime = fTime(FilePath, "", fCreation)
ResModificationTime = fTime(FilePath, "", fModify)
ResAccessTime = fTime(FilePath, "", fAccess)
IF ResCreationDate <> "" AND ResModificationTime <> "" AND ResAccessTime <> "" THEN
// Display the different times associated with the file
Info("The creation time is: " + ResCreationTime + CR + ...
"The modification time is: " + ResModificationTime + CR + ...
"The access time is: " + ResAccessTime)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example: Modifying the time of file creation
WINDEVReportes y ConsultasCódigo de Usuario (UMC) The following code is used replace the creation time of a file by the system time of the computer. This file is selected by fSelect.
// Declare the variables
ResCreationTime is string
ResSystemTime is string
FilePath is string
// Select a file
FilePath = fSelect("", "", "Selecting a file", ...
"All files (*.*)" + TAB + "*.*", "", fselOpen + fselExist)
// Retrieve the system time in HHMMSSCC format
ResSystemTime = TimeSys()
// Extract the system time in HHMMSS format
ResSystemTime = Left(ResSystemTime, 6)
// Modify the creation time of the selected file
ResCreationTime = fTime(FilePath, ResSystemTime, fCreation)
IF ResCreationDate <> "" THEN
// Display the time of file creation
Info("The creation time is now: " + ResCreationTime)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example: Retrieving the different times associated with a file (WEBDEV)
WEBDEV - Código ServidorPHPAjax The following code is used to find out the modification time and the access time associated with a file.
// Declare the variables
ResModificationTime is string
ResAccessTime is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
// Retrieve the file time information
ResModificationTime = fTime(FilePath, "", fModify)
ResAccessTime = fTime(FilePath, "", fAccess)
IF ResModificationTime <> "" AND ResAccessTime <> "" THEN
// Display the different times associated with the file
Info("The modification time is: " + ResModificationTime + CR + ...
"The access time is: " + ResAccessTime)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example: Modifying the modification time of a file (WEBDEV)
WEBDEV - Código ServidorPHPAjax The following code is used to replace the modification time of a file by the system time of the current computer.
// Declare the variables
ResModificationTime is string
ResSystemTime is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
 
// Retrieve the system time in HHMMSSCC format
ResSystemTime = TimeSys()
 
// Extract the system time in HHMMSS format
ResSystemTime = Left(ResSystemTime, 6)
 
// Change the modification time of the selected file
ResModificationTime = fTime(FilePath, ResSystemTime, fModify)
IF ResModificationDate <> "" THEN
// Display the modification time of the file
Info("The modification time is now: " + ResModificationTime)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
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: 23/08/2022

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