Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109275

Implement QFileInfo::birthTime() for Android

XMLWordPrintable

    • Android
    • 2022wk52FOQtforAndroid

      Currently, QFileInfo::birthTime() returns null, probably because the Android File API does not expose the information: https://developer.android.com/reference/java/io/File.html

      However, as of API Level 26, it is possible to retrieve it as a BasicFileAttribute (source: https://stackoverflow.com/a/48431255/1144539 ):

      File file = ...;
      BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class);
      long createdAt = attr.creationTime().toMillis();
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            assam Assam Boudjelthia
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes