[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:
Al
2017-03-10 13:39:43 -05:00
parent 3b33325c1a
commit b85ed70674
3 changed files with 8 additions and 4 deletions

View File

@@ -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;