Some directories are created to store the user's data but if they end up
not being used, they are deleted along with their content. It saves
space on the disk.
A nicer fix would be not to create the directories and their content in
the first place but I'll keep that for the next release.
exit(EXIT_FAILURE);
}
while ( (uinfo = userinfo_advancescan(uscan)) != NULL ) {
- if (!uinfo->topuser) {
- continue;
- }
- tmpsort(uinfo);
-
if (snprintf(warea,sizeof(warea),"%s/%s",outdirname,uinfo->filename)>=sizeof(warea)) {
debuga(_("Destination directory too long: %s/%s\n"),outdirname,uinfo->filename);
exit(EXIT_FAILURE);
}
+ if (!uinfo->topuser) {
+ //! \todo Instead of deleting the supernumerary directories, don't create them in the first place.
+ unlinkdir(warea,0);
+ continue;
+ }
+
if (access(warea, R_OK) != 0) {
if (mkdir(warea,0755)) {
debuga(_("Cannot create directory %s - %s\n"),warea,strerror(errno));
exit(EXIT_FAILURE);
}
}
+ tmpsort(uinfo);
report_day(uinfo);
greport_day(uinfo);