[utils] adding a function for checking if files exists (yay C), or at least the closest agreed-upon method for it (may return false if the user doesn't have permissions, but that's ok for our purposes here)
This commit is contained in:
@@ -47,11 +47,9 @@ bool shuffle_file_chunked(char *filename, size_t parts) {
|
||||
}
|
||||
|
||||
// Make sure the input file exists
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (f == NULL) {
|
||||
if (!file_exists(filename)) {
|
||||
return false;
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
// This is an in-place shuffle to keep the API simple
|
||||
char *outfile = filename;
|
||||
|
||||
Reference in New Issue
Block a user