git-annex/Remote
Joey Hess 29ae536637
adb send to final filename not tmp file
Avoids some problems with unusual character in exporttree filenames
that confuse adb shell commands.

In particular, with a filename that contains \351, adb push sends the file
to the correct filename in /sdcard. And running find on the android device
roundtrips the filename. But, running mv on that filename on the android
device fails with "bad <filename>: No such file or directory".
Interestingly, ls on android works, and rm fails.

adb push to the final name to avoids this problem. But what about
atomicity? Well, I tried an adb push and interrupted it part way through.
The file was present while the push was running, but was removed once the
push got interrupted. I also tried yanking the cable while adb push was
running, and the partially received file was also deleted then. That avoids
most problems.

An import that runs at the same time as an export will see the partially
sent file. But that is unlikely to be done, and if it did happen, it would
notice that the imported file had changed in the meantime and discard it.

Note that, since rm on the android device fails on these filenames,
exporting a tree where the file is deleted is going to fail to remove it. I
don't see what I can do about that, so long as android is using an rm that
has issues with filename encodings.

This was tested on a phone where find, ls, and rm all come from Toybox 0.8.6.

Sponsored-by: unqueued on Patreon
2023-09-11 13:13:05 -04:00
..
Directory improve createDirectoryUnder to allow alternate top directories 2022-08-12 12:52:37 -04:00
External let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Helper implement Unavilable for gcrypt 2023-08-16 15:54:54 -04:00
List auto-init autoenable=yes 2020-05-27 12:40:35 -04:00
Rsync add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
WebDAV Apply codespell -w throughout 2023-03-17 15:14:58 -04:00
Adb.hs adb send to final filename not tmp file 2023-09-11 13:13:05 -04:00
BitTorrent.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Borg.hs implement Unavilable for borg bup ddar directory rsync 2023-08-16 15:48:09 -04:00
Bup.hs implement Unavilable for borg bup ddar directory rsync 2023-08-16 15:48:09 -04:00
Ddar.hs implement Unavilable for borg bup ddar directory rsync 2023-08-16 15:48:09 -04:00
Directory.hs implement Unavilable for borg bup ddar directory rsync 2023-08-16 15:48:09 -04:00
External.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
GCrypt.hs implement Unavilable for gcrypt 2023-08-16 15:54:54 -04:00
Git.hs Override safe.bareRepository for git remotes 2023-09-07 14:56:26 -04:00
GitLFS.hs Removed the vendored git-lfs and the GitLfs build flag 2023-08-28 13:12:31 -04:00
Glacier.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Hook.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
HttpAlso.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
List.hs start borg special remote 2020-12-18 16:03:51 -04:00
P2P.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Rsync.hs implement Unavilable for borg bup ddar directory rsync 2023-08-16 15:48:09 -04:00
S3.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Tahoe.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
Web.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00
WebDAV.hs let Remote.availability return Unavilable 2023-08-16 14:31:31 -04:00