304 |
|
|
305 |
|
void automount(set<string>& mounts) |
306 |
|
{ |
307 |
+ |
DIR* dir = opendir(config.root.c_str()); |
308 |
+ |
dirent* file; |
309 |
+ |
|
310 |
+ |
while((file = readdir(dir)) != NULL) |
311 |
+ |
{ |
312 |
+ |
struct stat dir; |
313 |
+ |
string folder = config.root + "/" + file->d_name; |
314 |
+ |
|
315 |
+ |
stat(folder.c_str(), &dir); |
316 |
+ |
|
317 |
+ |
if (S_ISDIR(dir.st_mode)) |
318 |
+ |
{ |
319 |
+ |
string folder = file->d_name; |
320 |
+ |
|
321 |
+ |
if (folder == "." || folder == "..") continue; |
322 |
+ |
|
323 |
+ |
mounts.insert(folder); |
324 |
+ |
} |
325 |
+ |
} |
326 |
+ |
|
327 |
+ |
closedir(dir); |
328 |
+ |
|
329 |
+ |
if (debug) |
330 |
+ |
{ |
331 |
+ |
cerr << "mounts = {\n"; |
332 |
+ |
|
333 |
+ |
for (set<string>::iterator itor = mounts.begin(); itor != mounts.end(); |
334 |
+ |
itor++) |
335 |
+ |
{ |
336 |
+ |
cerr << " " << *itor << "\n"; |
337 |
+ |
} |
338 |
+ |
|
339 |
+ |
cerr << "}\n"; |
340 |
+ |
} |
341 |
|
} |
342 |
|
|
343 |
|
void configure() |