google / adb-sync

Apache License 2.0
1.09k stars 172 forks source link

Ignore unreadable files #57

Open koppor opened 3 years ago

koppor commented 3 years ago

When I execute the script, I get following output

INFO:root:Scanning and diffing...
ls: /storage/emulated/0/Android/data/ch.threema.app/files/tmp//.nomedia: Operation not permitted
INFO:root:Total: 0 bytes

Would it be possible to skip read errors? Maybe "only" the "Operation not permitted" errors?


Details:

Traceback (most recent call last):
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 883, in <module>
    main()
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 874, in main
    syncer.ScanAndDiff()
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 515, in ScanAndDiff
    self.local_only, self.both, self.remote_only = DiffLists(
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 403, in DiffLists
    b_revlist = sorted(b)
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 370, in BuildFileList
    for t in BuildFileList(fs, path + b'/' + n, follow_links,
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 370, in BuildFileList
    for t in BuildFileList(fs, path + b'/' + n, follow_links,
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 370, in BuildFileList
    for t in BuildFileList(fs, path + b'/' + n, follow_links,
  [Previous line repeated 2 more times]
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 367, in BuildFileList
    for n in files:
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 247, in listdir
    yield filename
  File "/mnt/c/git-repositories/adb-sync/adb-sync", line 86, in __exit__
    raise OSError('Subprocess exited with nonzero status.')
OSError: Subprocess exited with nonzero status.