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
  • Example 1: Recovering dates and times from a file
  • Example 2: Changing the creation date of a file
fDateTime (Example)
Example 1: Recovering dates and times from a file
WINDEV The following code is used to find out the different dates and times associated with a file.
// Declare the variables 
ResDateTimeCreation is string
ResDateTimeModification is string
ResDateTimeAccess is string
FilePath is string
// Select a file
FilePath = "C:\MyDirectories\File.txt"
// Retrieve the file date information
ResDateTimeCreation = fDateTime(FilePath, "", fCreation)
ResDateTimeModification = fDateTime(FilePath, "", fModify)
ResDateTimeAccess fDateTime(FilePath, "", fAccess)
IF ResDateTimeCreation <> "" AND ResDateTimeModification <> "" AND ResDateTimeAccess <> "" THEN
	// Display the different dates and times associated with a file
	Info("The date and time of creation is: " + ResDateTimeCreation + CR + ...
		"The date and time of modification is: " + ResDateModificationTime + CR + ...
		"Access date and time is: "+ ResDateAccessTime)
ELSE
	// Display an error message if the retrieval was not performed
	Error(ErrorInfo(errMessage))
END
Example 2: Changing the creation date of a file
WINDEV The following code is used to modify the creation date of a file by the system date of the computer.
// Declare the variables 
ResDateTimeCreation is string
ResDateTimeSystem is string
FileTimePath is string
// Select a file
FilePath = "C:\MyDirectories\File.txt"
// Retrieve the system date and time
ResDateTimeSystem = DateSys() + TimeSys()
// Change the creation date of the selected file
ResDateTimeCreation = fDateTime(FilePath, ResDateTimeSystem, fCreation)
IF ResDateTimeCreation <> "" THEN
	// Display the creation date
	Info("The date and time of creation is now: " + ResDateTimeCreation)
ELSE
	// Display an error message if the retrieval was not performed
	Error(ErrorInfo(errMessage))
END
Versión mínima requerida
  • Versión 10
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