MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / removeFileIfExists

Method removeFileIfExists

src/Disks/DiskLocal.cpp:463–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463void DiskLocal::removeFileIfExists(const String & path)
464{
465 auto fs_path = fs::path(disk_path) / path;
466 if (0 != unlink(fs_path.c_str()))
467 {
468 if (errno != ENOENT)
469 ErrnoException::throwFromPath(ErrorCodes::CANNOT_UNLINK, fs_path, "Cannot unlink file {}", fs_path);
470 }
471}
472
473void DiskLocal::removeDirectory(const String & path)
474{

Callers 15

executeImplMethod · 0.45
executeImplMethod · 0.45
commitCreateTableMethod · 0.45
dropTableMethod · 0.45
renameTableMethod · 0.45
iterateMetadataFilesMethod · 0.45
commitAlterTableMethod · 0.45
dropMethod · 0.45
commitCreateTableMethod · 0.45

Calls 1

unlinkFunction · 0.85

Tested by

no test coverage detected