Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_filesystem_delete_file ( CameraFilesystem fs,
const char *  folder,
const char *  filename,
GPContext context 

gp_filesystem_delete_file: : a CameraFilesystem : a folder in which to delete the file : the name of the file to delete : a GPContext

If a delete_file_func has been supplied to the , this function will be called and, if this function returns without error, the file will be removed from the .

Return value: a gphoto2 error code.

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

References _CameraFilesystem::delete_file_func, _CameraFilesystem::file_data, and gp_filesystem_number().

        int x, y;

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

      /* First of all, do we support file deletion? */
      if (!fs->delete_file_func) {
            gp_context_error (context, _("You have been trying to delete "
                  "'%s' from folder '%s', but the filesystem does not "
                  "support deletion of files."), filename, folder);
            return (GP_ERROR_NOT_SUPPORTED);

      /* Search the folder and the file */
      CR (x = gp_filesystem_folder_number (fs, folder, context));
      CR (y = gp_filesystem_number (fs, folder, filename, context));

      /* Delete the file */
      CR (fs->delete_file_func (fs, folder, filename,
                          fs->file_data, context));
      CR (delete_file (fs, x, y));

      return (GP_OK);

Generated by  Doxygen 1.6.0   Back to index