Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_camera_file_get ( Camera camera,
const char *  folder,
const char *  file,
CameraFileType  type,
CameraFile camera_file,
GPContext context 
)

Retrieves a file from the Camera.

Parameters:
camera a Camera
folder a folder
file the name of a file
type the CameraFileType
camera_file a CameraFile
context a GPContext
Returns:
a gphoto2 error code

Definition at line 1272 of file gphoto2-camera.c.

References CHECK_NULL, GP_ERROR_DIRECTORY_NOT_FOUND, GP_ERROR_FILE_NOT_FOUND, gp_file_clean(), gp_filesystem_get_file(), gp_log(), GP_LOG_DEBUG, and GP_OK.

Referenced by gp_camera_file_get_info().

{
      gp_log (GP_LOG_DEBUG, "gphoto2-camera", "Getting file '%s' in "
            "folder '%s'...", file, folder);

      CHECK_NULL (camera && folder && file && camera_file);
      CHECK_INIT (camera, context);

      CR (camera, gp_file_clean (camera_file), context);

      /* Did we get reasonable foldername/filename? */
      if (strlen (folder) == 0) {
            CAMERA_UNUSED (camera, context);
            return (GP_ERROR_DIRECTORY_NOT_FOUND);
      }
      if (strlen (file) == 0) {
            CAMERA_UNUSED (camera, context);
            return (GP_ERROR_FILE_NOT_FOUND);
      }
  
      CHECK_RESULT_OPEN_CLOSE (camera, gp_filesystem_get_file (camera->fs,
                  folder, file, type, camera_file, context), context);

      CAMERA_UNUSED (camera, context);
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index