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
Allow get/put folders from/to devices. #1563
Conversation
@nikias would you please check if there is further more working or ready for merge? |
Looks good from what I can tell from my phone, but could you |
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Done. Commit style and code style are changed |
i would suggest adding -r for recursive push/pull, and disable recursive by default. it's common practice for many other commandline copying tools also. |
|
I don't mind without a -r option, but let's make sure that maybe we don't overwrite existing directories. The same actually goes for files, you could easily break your device... |
This make sense, we may need an extra option for overwriting exist files. This PR will write to file directly if we have the write permission(for both side, device and local file system). I would make a change later, maybe a |
Yes -f makes sense. Without it and existing we should abort with an error message. |
it's not just cp and zip, abd is rather exception, than "good example". in linux most tools that manipulate files in commandline require -r (some -R) to do recursive work. adb is bad example for two reasons, major one is, that it does follow symlinks, and doesn't prevent cycling trough links (unless they fixed that, but that bug has been there for years), second is, that it has flawed long path handling (again, unless they fixed it over years) as for overwrite, i agree that -f (or --force) is good choice. |
… to allow recursive Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
Signed-off-by: tomriddly <tomriddly@qq.com>
symlinks cycling is what I've never considered, which makes |
thanks you, looks good to me. |
@nikias I've run local test and did not find any issue. Could this be merged? |
I pushed the commits with some small changes, merging the coding style fixes directly into the initial commits and prevent later code-style hiccups. Could you please check with latest commit if this works properly now? |
line 916, additional else {
printf("Error: Invalid number of arguments\n");
return;
} The other changes seem appropriate to me。 |
See 9ccc522. |
The original implementation of
get
andput
ofafcclient
supports only single file. This PR make it work for directories.