PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
Example: Modifying the time of file creation
Example: Retrieving the different times associated with a file (WEBDEV)
WEBDEV - Server codePHPAjax 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 different times associated with a file
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 - Server codePHPAjax 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)

// Modify 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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment