Working on "Use std::filesystem. Remove Boost Filesystem & System" #20744, I found an unfortunate [pitfall](https://github.com/bitcoin/bitcoin/pull/20744#issuecomment-946046666) -- `boost/process.hpp` depends on `boost::filesystem` when cross-compiling for Windows. It happens in Guix environment as well.

The goal of this issue is to discuss and find a solution to get rid of `boost::filesystem`.
{
    LOCK(cs_dir_locks);
    dir_locks.erase(fs::PathToString(directory / lockfile_name));
}
void ReleaseDirectoryLocks()
{
    LOCK(cs_dir_locks);
    dir_locks.clear();
}
bool DirIsWritable(const fs::path& directory)
{
    fs::path tmpFile = GetUniquePath(directory);
    FILE* file = fsbridge::fopen(tmpFile, "a");
    if (!file) return false;
    fclose(file);
    remove(tmpFile);
    return true;
}
bool CheckDiskSpace(const fs::path& dir, uint64_t additional_bytes)