Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QFileInfo
Qt 6.11 is out! See what's new in the release blog

QFileInfo

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 361 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sajad Ganie
    wrote on last edited by
    #1
        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?

    JonBJ 1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      Unable to understand the question.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • S Sajad Ganie
            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?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved