diff options
Diffstat (limited to 'vespalib/src/vespa/vespalib/io/fileutil.cpp')
-rw-r--r-- | vespalib/src/vespa/vespalib/io/fileutil.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/vespalib/src/vespa/vespalib/io/fileutil.cpp b/vespalib/src/vespa/vespalib/io/fileutil.cpp index 491e07e2491..8e074744d15 100644 --- a/vespalib/src/vespa/vespalib/io/fileutil.cpp +++ b/vespalib/src/vespa/vespalib/io/fileutil.cpp @@ -433,7 +433,7 @@ bool File::unlink() { close(); - return vespalib::unlink(_filename); + return std::filesystem::remove(std::filesystem::path(_filename)); } string @@ -507,22 +507,6 @@ fileExists(const string & path) { return (stat(path).get() != 0); } -bool -unlink(const string & filename) -{ - if (::unlink(filename.c_str()) != 0) { - if (errno == ENOENT) { - return false; - } - asciistream ost; - ost << "unlink(" << filename << "): Failed, errno(" << errno << "): " - << safeStrerror(errno); - throw IoException(ost.str(), IoException::getErrorType(errno), VESPA_STRLOC); - } - LOG(debug, "unlink(%s): File deleted.", filename.c_str()); - return true; -} - namespace { uint32_t diskAlignmentSize = 4_Ki; |