Skip to content
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

AFC - put_path doesn't work with directories. #1

Closed
tuckerwales opened this issue Dec 29, 2013 · 5 comments
Closed

AFC - put_path doesn't work with directories. #1

tuckerwales opened this issue Dec 29, 2013 · 5 comments

Comments

@tuckerwales
Copy link

afc.put_path doesn't work when trying to place a directory.

@emonti
Copy link
Contributor

emonti commented Dec 31, 2013

Isn't afc.mkdir what you want here? (serious question, put another way, what's the expected behavior for put_path?)

@tuckerwales
Copy link
Author

mkdir makes a directory - it doesn't copy a directory recursively.

put_path should be able to traverse down directories:

Copying of a .app, for example, will not work because it is a directory.

@emonti
Copy link
Contributor

emonti commented Jan 7, 2014

ah ok, I kind-of left recursive AFC operations out intentionally (or left as an exercise to the implementor). That said, it's pretty easy to add one for put_path -- it gets uglier when you want to recursively get, remove, or rename over afc, though.

I'll add an AFC.put_recursively and some argument handling to make it work via put_path. But i think the default behavior should still be to operate without recursing.

On the subject of recursing via AFC, though:
I did some digging around in the afc server binary and found out there are several AFC message types which are not (yet?) implemented in libimobiledevice that might help here, though. I'll look into getting these added to libimobiledevice, but it's ultimately up to them whether to add support...

#define GetSizeOfPathContents   0x21
#define RemovePathAndContents   0x22
#define DirectoryEnumeratorRefOpen          0x23
#define DirectoryEnumeratorRefOpenResult    0x24
#define DirectoryEnumeratorRefRead          0x25
#define DirectoryEnumeratorRefClose         0x26

@emonti
Copy link
Contributor

emonti commented Jan 7, 2014

Ok, recursive put support is added as of idevice v1.1.5.6

to use it, either do

afc.put_recursively("somelocaldir", "someremotediralreadyexists/")

or
afc.put_path("somelocaldir", "someremotediralreadyexists/", recurse: true)

as for recursive get/remove/rename -- those are still left un-implemented pending seeing what happens with adding support for the additional native code AFC operations

@emonti
Copy link
Contributor

emonti commented Jan 7, 2014

minor tweak added for v1.1.5.7 -- absolute local paths weren't handled correctly, they should be now. Sorry, i should have tested, but i don't want to add rspec device tests until we get recursive removes working, it'll leave crap all over the device... =/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants