View Single Post
Old 10-28-2011, 10:10 AM   #1
myudkowsky
Enthusiast
myudkowsky began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
Device Mounted as MTP file system does not allow writing to folders

I have an Asus Transformer, which uses the MTP protocol. Although it might be possible in theory to connect it as an ordinary USB device, I mount this on my computer to create an accessible folder called /media/mtp.

I created /media/mtp/Books to act as the repository for my calibre library. I used the "connect to folder" option to transfer books.

This transfer consistently fails. The error report is:

Quote:
calibre, version 0.8.24
ERROR: Error: Error communicating with device

[Errno 38] Function not implemented: u'/media/mtp/Books/.metadata.calibre'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 81, in run
File "site-packages/calibre/gui2/device.py", line 354, in _sync_booklists
File "site-packages/calibre/devices/usbms/driver.py", line 383, in sync_booklists
File "site-packages/calibre/devices/usbms/driver.py", line 381, in write_prefix
IOError: [Errno 38] Function not implemented: u'/media/mtp/Books/.metadata.calibre'
The contents of .driveinfo.clalibre make sense, namely a hash or JSON:
Quote:
{"device_store_uuid": "09d163b0-a733-4bd6-a266-8ec18442e2e0", "prefix": "/media/mtp/Books/", "device_name": "Folder Device", "calibre_version": "0.8.24", "location_code": "main", "last_library_uuid": "4b0acef2-8fee-4003-a47b-2c0243d1c048", "date_last_connected": "2011-10-28T13:37:34.989924+00:00"}
The contents of .metaata.calibre are simple "[]", an empty array.

After this erorr, books are on the device but Calibre fails to recognize them. When I attempt re-connect to the device, I get a similar error:
Quote:
Underlying error: [Errno 38] Function not implemented: u'/media/mtp/Books/.driveinfo.calibre'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 81, in run
File "site-packages/calibre/gui2/device.py", line 312, in _get_device_information
File "site-packages/calibre/devices/usbms/driver.py", line 106, in get_device_information
IOError: Failed to access files in the main memory of your device. You should contact the device manufacturer for support. Common fixes are: try a different USB cable/USB port on your computer. If you device has a "Reset to factory defaults" type of setting somewhere, use it. Underlying error: [Errno 38] Function not implemented: u'/media/mtp/Books/.driveinfo.calibre'
My guess is that these files can't be re-written by calibre. According to the filesystem, these files are set to rwx for everyone, not just the user (an apparent quirk of the mtp library).

The work-around would be to either figure out how to make the device appear as a USB device, or to create a local "shadow" folder that shadows the device's books folder and sync that shadow folder to the device.

However, perhaps there's some setting, tweak, or bug that causes this problem. Any suggestions?
myudkowsky is offline   Reply With Quote