1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

fixed : detection of non-existing file

better error message
with test
This commit is contained in:
Yann Collet
2018-12-19 18:30:57 -08:00
parent 0f2d443e10
commit 173ef9dea2
4 changed files with 35 additions and 18 deletions

View File

@ -16,8 +16,18 @@ extern "C" {
/*-****************************************
* Dependencies
******************************************/
#include <string.h> /* strncmp */
#include <errno.h>
#include "util.h"
int UTIL_fileExist(const char* filename)
{
stat_t statbuf;
int const stat_success = stat(filename, &statbuf);
return !stat_success;
}
int UTIL_isRegularFile(const char* infilename)
{
stat_t statbuf;
@ -651,4 +661,3 @@ int UTIL_countPhysicalCores(void)
#if defined (__cplusplus)
}
#endif