.TH "objects" 3 "Version 1.1.21" "libmtp" \" -*- nroff -*- .ad l .nh .SH NAME libmtp \- objects .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "int \fBLIBMTP_Delete_Object\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t)" .br .ti -1c .RI "int \fBLIBMTP_Move_Object\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t, uint32_t, uint32_t)" .br .ti -1c .RI "int \fBLIBMTP_Copy_Object\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t, uint32_t, uint32_t)" .br .ti -1c .RI "int \fBLIBMTP_Set_Object_Filename\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t, char *)" .br .ti -1c .RI "int \fBLIBMTP_GetPartialObject\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, uint64_t, uint32_t, unsigned char **, unsigned int *)" .br .ti -1c .RI "int \fBLIBMTP_SendPartialObject\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, uint64_t, unsigned char *, unsigned int)" .br .ti -1c .RI "int \fBLIBMTP_BeginEditObject\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const)" .br .ti -1c .RI "int \fBLIBMTP_EndEditObject\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const)" .br .ti -1c .RI "int \fBLIBMTP_TruncateObject\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, uint64_t)" .br .in -1c .SH "Detailed Description" .PP .SH "Function Documentation" .PP .SS "int LIBMTP_Copy_Object (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t object_id, uint32_t storage_id, uint32_t parent_id)" The function copies an object from one location on a device to another location\&. .PP The semantics of copying a folder are not defined in the spec, but it appears to do the right thing when tested (but devices that implement this operation are rare)\&. .PP Note that copying an object may take a significant amount of time\&. MTP does not provide any kind of progress mechanism, so the operation will simply block for the duration\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device where the object exists\&. .br \fIobject_id\fP the object to copy\&. .br \fIstorage_id\fP the id of the destination storage\&. .br \fIparent_id\fP the id of the destination parent object (folder)\&. If the destination is the root of the storage, pass '0'\&. .RE .PP \fBReturns\fP .RS 4 0 on success, any other value means failure\&. .RE .PP .PP References \fBLIBMTP_mtpdevice_struct::params\fP\&. .SS "int LIBMTP_Delete_Object (\fBLIBMTP_mtpdevice_t\fP * 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\&. .PP 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\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to delete the object from\&. .br \fIobject_id\fP the object to delete\&. .RE .PP \fBReturns\fP .RS 4 0 on success, any other value means failure\&. .RE .PP .PP References \fBLIBMTP_mtpdevice_struct::params\fP\&. .SS "int LIBMTP_Move_Object (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t object_id, uint32_t storage_id, uint32_t parent_id)" The function moves an object from one location on a device to another location\&. .PP The semantics of moving a folder are not defined in the spec, but it appears to do the right thing when tested (but devices that implement this operation are rare)\&. .PP Note that moving an object may take a significant amount of time, particularly if being moved between storages\&. MTP does not provide any kind of progress mechanism, so the operation will simply block for the duration\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device where the object exists\&. .br \fIobject_id\fP the object to move\&. .br \fIstorage_id\fP the id of the destination storage\&. .br \fIparent_id\fP the id of the destination parent object (folder)\&. If the destination is the root of the storage, pass '0'\&. .RE .PP \fBReturns\fP .RS 4 0 on success, any other value means failure\&. .RE .PP .PP References \fBLIBMTP_mtpdevice_struct::params\fP\&. .SS "int LIBMTP_Set_Object_Filename (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t object_id, char * newname)" THIS FUNCTION IS DEPRECATED\&. PLEASE UPDATE YOUR CODE IN ORDER NOT TO USE IT\&. .PP \fBSee also\fP .RS 4 \fBLIBMTP_Set_File_Name()\fP .PP \fBLIBMTP_Set_Track_Name()\fP .PP \fBLIBMTP_Set_Folder_Name()\fP .PP \fBLIBMTP_Set_Playlist_Name()\fP .PP \fBLIBMTP_Set_Album_Name()\fP .RE .PP .PP References \fBLIBMTP_file_struct::filetype\fP, and \fBLIBMTP_Get_Filemetadata()\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libmtp from the source code\&.