Man hat viele Dateien, die nicht auf ein Medium (z.B. DVD) passen.
discpan teilt eine Textdatei mit den Pfaden aller Dateien auf.
Die Dateien werden aufgeteilt mit dem Outputnamen und einer dreistelligen Durchnummerierung.
+Sollten Dateien, die größer sind als das Medium, dabei sein, dann werden diese Dateien in einer ignore Datei landen.
------------
Installation
return -2;
}
-void filesize_sort(const char *input, const char *output)
+void filesize_sort(const char *input, const char *output, const long long unsigned int split)
{
- FILE *in; FILE *out;
+ FILE *in; FILE *out; FILE *ignore;
char pfad[255];
struct stat st;
int lines = 0;
while(fscanf(in, "%[^\n]\n", pfad) == 1)
{
stat(pfad, &st);
- strcpy(fs[lines].name, pfad);
- fs[lines++].fsize = st.st_size;
+ if(st.st_size <= split)
+ {
+ strcpy(fs[lines].name, pfad);
+ fs[lines++].fsize = st.st_size;
+ }
+ else
+ {
+ if(exists("ignore") == 1)
+ ignore = fopen("ignore", "w");
+ fprintf(ignore, "%s\n", pfad);
+ }
}
qsort(fs, lines, sizeof(struct file_size), cmpfunc);
int i;
}
fclose(in);
fclose(out);
+ if(exists("ignore") == 0)
+ fclose(ignore);
}
void usage()
}
}
- filesize_sort(input, rest);
+ filesize_sort(input, rest, split);
while(exists(rest) == 0)
{
sprintf(outname, "%s%03d",output , num++);