ERROR("usage: sdcard [-l -f] <path> <uid> <gid>\n\n\t-l force file names to lower case when creating new files\n\t-f fix up any existing file names at are not lower case\n");
return-1;
}
intmain(intargc,char**argv)
{
structfusefuse;
charopts[256];
intfd;
intres;
unsigneduid;
unsignedgid;
constchar*path;
if(argc!=4){
ERROR("usage: sdcard <path> <uid> <gid>\n");
return-1;
unsigneduid=-1;
unsignedgid=-1;
constchar*path=NULL;
intcheck_files=0;
inti;
for(i=1;i<argc;i++){
char*arg=argv[i];
if(arg[0]=='-'){
if(!strcmp(arg,"-l")){
force_lower_case=1;
ERROR("force_lower_case\n");
}elseif(!strcmp(arg,"-f")){
check_files=1;
ERROR("check_files\n");
}else{
returnusage();
}
}else{
if(!path)
path=arg;
elseif(uid==-1)
uid=strtoul(arg,0,10);
elseif(gid==-1)
gid=strtoul(arg,0,10);
else{
ERROR("too many arguments\n");
returnusage();
}
}
}
uid=strtoul(argv[2],0,10);
gid=strtoul(argv[3],0,10);
if(!uid||!gid){
if(!path){
ERROR("no path specified\n");
returnusage();
}
if(uid<=0||gid<=0){
ERROR("uid and gid must be nonzero\n");
return-1;
returnusage();
}
path=argv[1];
/* cleanup from previous instance, if necessary */
umount2(MOUNT_POINT,2);
@@ -894,6 +994,9 @@ int main(int argc, char **argv)