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
Windows Mobile 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 different times associated with a file
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
Windows Mobile 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)
Example: Modifying the modification time of a file (WEBDEV)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment