MCPcopy Create free account
hub / github.com/boostorg/filesystem / remove_impl

Function remove_impl

src/operations.cpp:1094–1114  ·  view source on GitHub ↗

remove() implementation

Source from the content-addressed store, hash-verified

1092
1093//! remove() implementation
1094inline bool remove_impl(path const& p, error_code* ec)
1095{
1096 // Since POSIX remove() is specified to work with either files or directories, in a
1097 // perfect world it could just be called. But some important real-world operating
1098 // systems (Windows, Mac OS, for example) don't implement the POSIX spec. So
1099 // we have to distinguish between files and directories and call corresponding APIs
1100 // to remove them.
1101
1102 error_code local_ec;
1103 fs::file_type type = fs::detail::symlink_status_impl(p, &local_ec).type();
1104 if (BOOST_UNLIKELY(type == fs::status_error))
1105 {
1106 if (!ec)
1107 BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::remove", p, local_ec));
1108
1109 *ec = local_ec;
1110 return false;
1111 }
1112
1113 return fs::detail::remove_impl(p, type, ec);
1114}
1115
1116//! remove_all() implementation
1117uintmax_t remove_all_impl

Callers 2

operations.cppFile · 0.85
removeFunction · 0.85

Calls 8

symlink_status_implFunction · 0.85
atomic_load_relaxedFunction · 0.85
remove_nt6_implFunction · 0.85
not_found_errorFunction · 0.85
emit_errorFunction · 0.85
remove_nt5_implFunction · 0.85
typeMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected