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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user