The lpath (logical path) is supposed to be the path from the device/format root to the format to the file. There is no guaranteed relationship between the location of metadata.calibre, if it exists, and the lpath. In my experience the lpath is always right once one finds the right root.
Calibre puts the metadata.calibre etc in what it thinks is the root of the filesystem, which can vary according to the device driver. IIRC this is the mount point. For example and again IIRC, for the folder device the "root" is the mount point and always the prefix for the control files. The Android driver used MTP which imposes its own translations.
The driveinfo.calibre contains the lpath prefix that the driver uses to write files. Again, this value depends on the driver. For the folder device it is the path to the folder. For other devices it is the prefix that is used to navigate from whatever root the device supports.
It should be true that for a given device using the standard device interface, the concatenation of one of the values in driveinfo (possible roots for the library) and the lpath should get you to the book. The trick is to know whether that device has a "special" root folder that is exposed via the interface, and which of the 3 paths the book has used (main, card_a, card_b). However, looking at the code the MTP device doesn't seem to follow these rules, instead using a path-per-format specified by the user.
Is there something specific you are looking for?
|