The object management API.


Functions

int LIBMTP_Delete_Object (LIBMTP_mtpdevice_t *, uint32_t)
int LIBMTP_Set_Object_Filename (LIBMTP_mtpdevice_t *, uint32_t, char *)

Function Documentation

int LIBMTP_Delete_Object ( LIBMTP_mtpdevice_t device,
uint32_t  object_id 
)

This function deletes a single file, track, playlist, folder or any other object off the MTP device, identified by the object ID.

If you delete a folder, there is no guarantee that the device will really delete all the files that were in that folder, rather it is expected that they will not be deleted, and will turn up in object listings with parent set to a non-existant object ID. The safe way to do this is to recursively delete all files (and folders) contained in the folder, then the folder itself.

Parameters:
device a pointer to the device to delete the object from.
object_id the object to delete.
Returns:
0 on success, any other value means failure.

References LIBMTP_mtpdevice_struct::params.

int LIBMTP_Set_Object_Filename ( LIBMTP_mtpdevice_t device,
uint32_t  object_id,
char *  newname 
)

This function renames a single file, track, playlist, folder or any other object on the MTP device, identified by an object ID. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device.

Parameters:
device a pointer to the device that contains the the file, track, foler, playlist or other object to set the filename for.
object_id the ID of the object to rename.
newname the new filename for this object. You MUST assume that this string can be modified by the call to this function, since some devices have restrictions as to which filenames may be used on them.
Returns:
0 on success, any other value means failure.

References DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST, DEVICE_FLAG_ONLY_7BIT_FILENAMES, LIBMTP_file_struct::filetype, LIBMTP_destroy_file_t(), LIBMTP_Get_Filemetadata(), LIBMTP_mtpdevice_struct::params, strip_7bit_from_utf8(), and LIBMTP_mtpdevice_struct::usbinfo.


Generated on Sat Jun 28 12:07:54 2008 for libmtp by  doxygen 1.5.6