Qt 6.11 is out! See what's new in the release
blog
QFileInfo
-
QFileInfo fileInfo("/run/media/A"); // "/run/media/A" is my sd card path fileInfo.setCaching(false); QDateTime buildtime = fileInfo.lastModified(); return buildtime.toString();using this code i am able to get the lastModified time of newly created file but not of the file which is modified?
-
Unable to understand the question.
-
QFileInfo fileInfo("/run/media/A"); // "/run/media/A" is my sd card path fileInfo.setCaching(false); QDateTime buildtime = fileInfo.lastModified(); return buildtime.toString();using this code i am able to get the lastModified time of newly created file but not of the file which is modified?
@Sajad-Ganie
This should get the correct last modified time of an existing file being modified as well as one just created, provided the OS supports that. How do you know that an external file has had its last modified time changed at the instant this is called? Don't forget that if, for example, another process has the file open for update the last modified time may well not be altered until the file is closed by that process.