Skip to content

Is there a way to preserve timestamps on pull? #10

@cobaltdr

Description

@cobaltdr

Hello.

Is there a way to preserve timestamps on pull, and optionally permissions?

[edit]
Never mind, in ppadb/device.py:
Instead of
self._pull(str(src), str(dest))
have

self._pull(str(src), str(dest))
           try:
               mtime_str = self.shell(f"stat --format='%.Y' \"{src}\"")
               mtime_float = float(mtime_str)
               os.utime(dest, (mtime_float, mtime_float))
           except:
               print(f"Setting mtime failed {dest}")

And of course at the top of the file:
import os

Permissions is a nightmare across different filesystems, so have left that alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions