Skip to content

Commit

Permalink
Do not return error when file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
martaiborra committed Jul 24, 2023
1 parent e11cb2d commit 742e9f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blosc/directories.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "blosc2.h"

#include <sys/stat.h>
#include <errno.h>

#include <stdlib.h>
#include <stdio.h>
Expand Down Expand Up @@ -130,6 +131,10 @@ int blosc2_remove_urlpath(const char* urlpath){
if (urlpath != NULL) {
struct stat statbuf;
if (stat(urlpath, &statbuf) != 0){
if (errno == ENOENT) {
// Path does not exist
return BLOSC2_ERROR_SUCCESS;
}
BLOSC_TRACE_ERROR("Could not access %s", urlpath);
return BLOSC2_ERROR_FAILURE;
}
Expand Down

0 comments on commit 742e9f5

Please sign in to comment.