#include "common.h"
#include <stdlib.h>
{
printf(
"File ID: %u\n", file->
item_id);
printf(
" Filename: %s\n", file->
filename);
printf(" None. (abstract file, size = -1)\n");
} else {
#ifdef __WIN32__
#else
printf(" File size %llu (0x%016llX) bytes\n",
(
long long unsigned int) file->
filesize,
(
long long unsigned int) file->
filesize);
#endif
}
printf(
" Storage ID: 0x%08X\n", file->
storage_id);
}
static void
{
storageid,
leaf);
if (files == NULL) {
} else {
file = files;
while (file != NULL) {
if (file->
filetype == LIBMTP_FILETYPE_FOLDER) {
dump_files(device, storageid, file->
item_id);
} else {
dump_fileinfo(file);
}
tmp = file;
}
}
}
int main(int argc, char **argv)
{
int numrawdevices;
int i;
fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n");
switch(err)
{
case LIBMTP_ERROR_NO_DEVICE_ATTACHED:
fprintf(stdout, "mtp-files: No Devices have been found\n");
return 0;
case LIBMTP_ERROR_CONNECTING:
fprintf(stderr, "mtp-files: There has been an error connecting. Exit\n");
return 1;
case LIBMTP_ERROR_MEMORY_ALLOCATION:
fprintf(stderr, "mtp-files: Memory Allocation Error. Exit\n");
return 1;
case LIBMTP_ERROR_GENERAL:
default:
fprintf(stderr, "mtp-files: Unknown error, please report "
"this to the libmtp developers\n");
return 1;
case LIBMTP_ERROR_NONE:
fprintf(stdout, "mtp-files: Successfully connected\n");
fflush(stdout);
break;
}
for (i = 0; i < numrawdevices; i++) {
char *friendlyname;
if (device == NULL) {
fprintf(stderr, "Unable to open raw device %d\n", i);
continue;
}
if (friendlyname == NULL) {
printf("Listing File Information on Device with name: (NULL)\n");
} else {
printf("Listing File Information on Device with name: %s\n", friendlyname);
free(friendlyname);
}
for (storage = device->
storage; storage != 0; storage = storage->
next) {
dump_files(device, storage->
id, 0);
}
}
free(rawdevices);
printf("OK.\n");
exit (0);
}