mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Added mkdir() to libiMobileDevice
This commit is contained in:
parent
ee556b867c
commit
144f66c13b
@ -418,6 +418,14 @@ class libiMobileDevice():
|
|||||||
if False:
|
if False:
|
||||||
self._idevice_set_debug_level(DEBUG)
|
self._idevice_set_debug_level(DEBUG)
|
||||||
|
|
||||||
|
def mkdir(self, path):
|
||||||
|
'''
|
||||||
|
Mimic mkdir(), creating a directory at path. Does not create
|
||||||
|
intermediate folders
|
||||||
|
'''
|
||||||
|
self._log_location("'%s'" % path)
|
||||||
|
return self._afc_make_directory(path)
|
||||||
|
|
||||||
def mount_ios_app(self, app_name=None, app_id=None):
|
def mount_ios_app(self, app_name=None, app_id=None):
|
||||||
'''
|
'''
|
||||||
Convenience method to get iDevice ready to talk to app_name or app_id
|
Convenience method to get iDevice ready to talk to app_name or app_id
|
||||||
@ -1007,6 +1015,27 @@ class libiMobileDevice():
|
|||||||
self.log(" %s: %s" % (key, file_stats[key]))
|
self.log(" %s: %s" % (key, file_stats[key]))
|
||||||
return file_stats
|
return file_stats
|
||||||
|
|
||||||
|
def _afc_make_directory(self, path):
|
||||||
|
'''
|
||||||
|
Creates a directory on the device. Does not create intermediate dirs.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
client: (AFC_CLIENT_T) The client to use to make a directory
|
||||||
|
dir: (const char *) The directory's fully-qualified path
|
||||||
|
|
||||||
|
Result:
|
||||||
|
error: AFC_E_SUCCESS on success or an AFC_E_* error value
|
||||||
|
'''
|
||||||
|
self._log_location("%s" % repr(path))
|
||||||
|
|
||||||
|
error = self.lib.afc_make_directory(byref(self.afc),
|
||||||
|
str(path)) & 0xFFFF
|
||||||
|
if error:
|
||||||
|
if self.verbose:
|
||||||
|
self.log(" ERROR: %s" % self._afc_error(error))
|
||||||
|
|
||||||
|
return error
|
||||||
|
|
||||||
def _afc_read_directory(self, directory=''):
|
def _afc_read_directory(self, directory=''):
|
||||||
'''
|
'''
|
||||||
Gets a directory listing of the directory requested
|
Gets a directory listing of the directory requested
|
||||||
|
Loading…
x
Reference in New Issue
Block a user