-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAF breaks recursive copy to phone #205
Comments
SAF API is much harder to work with than FileSystem API. It is no suprise that such bugs happen. It will take a while until I find time to look into this. |
See #372 Here at line 72 the original version returned a SafFile for /sdcard/Documents The proposed change still has issues line 114. In case of plain old file-system, this is not an issue to create a file without creating a new folder, FsFile has a workaround for this here. We should do something like FsFile in SafFile/RoSafFile, but it is hard, SafFile requires an existing parentDocument, and in this case it is nonexistent. More investigation is needed. At least this issue helped to think about the correct solution for the #372 #373 PR-s. |
I got it fixed in #395. This started to be a one-liner fix, but evolved into a multiday refactor project. :) Tests are OK, now I'm testing it on my phone, I hope it will be part of the next release. |
As the PRs are merged this should be solved. |
On GrapheneOS (which closely tracks the latest AOSP release), SAF mode in primftpd v6.5 or older breaks when copying a directory (that didn't already exist) and its contents to my phone.
In primftpd:
I choose SAF, select the main
/sdcard
directory, and start the SFTP server.On my computer:
I create a directory named
dir
containing three files (file-a.txt
,file-b.txt
,file-c.txt
), and runscp -v -r dir my-phone:Documents
. The output from scp (OpenSSH 8.3p1) looks fine:But if
/sdcard/Documents/dir/
didn't already exist before I ran the scp command, primftpd creates/sdcard/Documents/dir/
/sdcard/Documents/dir (1)
with the content fromfile-c.txt
/sdcard/Documents/dir (2)
with the content fromfile-b.txt
/sdcard/Documents/dir (3)
with the content fromfile-a.txt
This problem doesn't occur in "plain old filesystem" mode instead of SAF.
The text was updated successfully, but these errors were encountered: