Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_filesystem_get_info ( CameraFilesystem fs,
const char *  folder,
const char *  filename,
CameraFileInfo *  info,
GPContext context 

gp_filesystem_get_info: : a CameraFilesystem : : : : a GPContext

Return value: a gphoto2 error code.

Definition at line 1691 of file gphoto2-filesys.c.

References _CameraFilesystem::folder, _CameraFilesystem::get_info_func, gp_filesystem_number(), and _CameraFilesystem::info_data.

      int x, y;
#ifdef HAVE_EXIF
      time_t t;

      CHECK_NULL (fs && folder && filename && info);
      CC (context);
      CA (folder, context);

      GP_DEBUG ("Getting information about '%s' in '%s'...", filename,

      if (!fs->get_info_func) {
            gp_context_error (context,
                  _("The filesystem doesn't support getting file "
            return (GP_ERROR_NOT_SUPPORTED);

      /* Search folder and file and get info if needed */
      CR (x = gp_filesystem_folder_number (fs, folder, context));
      CR (y = gp_filesystem_number (fs, folder, filename, context));
      if (fs->folder[x].file[y].info_dirty) {
            CR (fs->get_info_func (fs, folder, filename, 
                                    fs->info_data, context));
            fs->folder[x].file[y].info_dirty = 0;

       * If we didn't get GP_FILE_INFO_MTIME, we'll have a look if we
       * can get it from EXIF data.
#ifdef HAVE_EXIF
      if (!(fs->folder[x].file[y].info.file.fields & GP_FILE_INFO_MTIME)) {
            GP_DEBUG ("Did not get mtime. Trying EXIF information...");
            t = gp_filesystem_get_exif_mtime (fs, folder, filename);
            if (t) {
                  fs->folder[x].file[y].info.file.mtime = t;
                  fs->folder[x].file[y].info.file.fields |=

      memcpy (info, &fs->folder[x].file[y].info, sizeof (CameraFileInfo));

      return (GP_OK);

Generated by  Doxygen 1.6.0   Back to index