support autodetection of disk ports. stat for dcim/ or DCIM/ directories.

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8207 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2005-08-14 15:17:39 +00:00
parent 9874e8a148
commit 22efc91425

View File

@@ -407,6 +407,23 @@ gp_abilities_list_detect (CameraAbilitiesList *list,
break;
}
case GP_PORT_DISK: {
char *s, path[1024];
struct stat stbuf;
s = strchr (info.path, ':');
if (!s)
break;
s++;
snprintf (path, sizeof(path), "%s/DCIM", s);
if (-1 == stat(path, &stbuf)) {
snprintf (path, sizeof(path), "%s/dcim", s);
if (-1 == stat(path, &stbuf))
continue;
}
gp_list_append (l, "Directory Browse", info.path);
break;
}
default:
/*
* We currently cannot detect any cameras on this