termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.25k stars 449 forks source link

Expose last-modified times #670

Open BryanJacobs opened 6 months ago

BryanJacobs commented 6 months ago

This exposes the last modified times of files, where available, to commands like termux-saf-ls and termux-saf-stat.

I wrote https://github.com/BryanJacobs/saf_sync/ but it's badly hampered by not being able to see file modification times. Exposing this already-available information would avoid unnecessary copies.

Example output when testing with a real Termux on an actual Android device:

  {
    "name": "myfile.bin",
    "type": "application/octet-stream",
    "uri": "content://com.android.externalstorage.documents/tree/primary%3Atest/document/primary%3Atest%2Fmyfile.bin",
    "length": 384,
    "last_modified": 2126636192
  },