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

int gp_filesystem_make_dir ( CameraFilesystem fs,
const char *  folder,
const char *  name,
GPContext context 

Create a subfolder within a folder.

fs a CameraFilesystem
folder the folder in which the directory should be created
name the name of the directory to be created
context a GPContext
Creates a new directory called name in given folder.

a gphoto2 error code

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

References CHECK_NULL, _CameraFilesystem::folder_data, GP_ERROR_DIRECTORY_NOT_FOUND, GP_ERROR_NOT_SUPPORTED, _CameraFilesystem::make_dir_func, and _CameraFilesystem::rootfolder.

Referenced by gp_camera_folder_make_dir().

      CameraFilesystemFolder  *f;

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

      if (!fs->make_dir_func)
            return (GP_ERROR_NOT_SUPPORTED);

      /* Search the folder */
      f = lookup_folder (fs, fs->rootfolder, folder, context);
      if (!f) return (GP_ERROR_DIRECTORY_NOT_FOUND);

      /* Create the directory */
      CR (fs->make_dir_func (fs, folder, name, fs->folder_data, context));
      /* and append to internal fs */
      return append_folder_one (f, name, NULL);

Generated by  Doxygen 1.6.0   Back to index