diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2021-10-02 13:23:36 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2021-10-02 13:23:36 +0200 |
commit | 409dfcedf47f26e38b9e4fd5055d6314b7dd2574 (patch) | |
tree | c1120c0104e4fa68fd27d144aa5bc21997e3edc1 /examples | |
parent | 0e784bb40cd27854d118e5da01d9ec845c93bd9e (diff) | |
download | libgphoto2-409dfcedf47f26e38b9e4fd5055d6314b7dd2574.tar.gz |
report file info for debugging
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sample-tether.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/sample-tether.c b/examples/sample-tether.c index 333eeede1..c8e8104ea 100644 --- a/examples/sample-tether.c +++ b/examples/sample-tether.c @@ -24,11 +24,12 @@ static void errordumper(GPLogLevel level, const char *domain, const char *str, static void camera_tether(Camera *camera, GPContext *context) { - int fd, retval; - CameraFile *file; + int fd, retval; + CameraFile *file; CameraEventType evttype; CameraFilePath *path; - void *evtdata; + CameraFileInfo info; + void *evtdata; printf("Tethering...\n"); @@ -41,6 +42,12 @@ camera_tether(Camera *camera, GPContext *context) { path = (CameraFilePath*)evtdata; printf("File added on the camera: %s/%s\n", path->folder, path->name); + retval = gp_camera_file_get_info (camera, path->folder, path->name, &info, context); + printf (" info reported flags: %d\n", info.file.fields); + printf (" info reported mtime: %ld\n", info.file.mtime); + printf (" info reported size: %ld\n", info.file.size); + printf (" info reported type: %s\n", info.file.type); + fd = open (path->name, O_CREAT | O_WRONLY | O_BINARY, 0644); retval = gp_file_new_from_fd(&file, fd); printf(" Downloading %s...\n", path->name); |