ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Example: Retrieve the file date information
  • Example: Modifying the creation date of a file
Example: Retrieve the file date information
Reports and Queries The following code is used to find out the differents dates associated with a file.
// Declare the variables
ResCreationDate is string
ResModificationDate is string
ResAccessDate is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
 
// Retrieve the file date information
ResCreationDate = fDate(FilePath, "", fCreation)
ResModificationDate = fDate(FilePath, "", fModify)
ResAccessDate = fDate(FilePath, "", fAccess)
IF ResCreationDate <> "" AND ResModificationDate <> "" AND ResAccessDate <> "" THEN
// Display the dates associated with the file
Info("The creation date is: " + ResCreationDate + CR + ...
"The modification date is: " + ResModificationDate + CR + ...
"The access date is: " + ResAccessDate)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example: Modifying the creation date of a file
Reports and Queries The following code is used to modify the creation date of a file by the system date of the computer.
// Declare the variables
ResCreationDate is string
ResSystemDate is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
 
// Retrieve the system date in YYYYMMDD format
ResSystemDate = DateSys()
// Modify the creation date of the selected file
ResCreationDate = fDate(FilePath, ResSystemDate, fCreation)
IF ResCreationDate <> "" THEN
// Display the creation date
Info("The creation date is now: " + ResCreationDate)
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

Last update: 08/22/2022

Send a report | Local help