std::filesystem::current_path().generic_string()的bug

这行指令出来会出来大小写的盘符,如D 或者d,似乎随机

复制代码
#include <iostream>
#include <filesystem>
 
namespace fs = std::filesystem;
 
bool arePathsSame(const fs::path& p1, const fs::path& p2) {
    return p1 == p2;
}
 
int main() {
    fs::path path1 = "/home/user/file.txt";
    fs::path path2 = "/home/user/file.txt";
 
    if (arePathsSame(path1, path2)) {
        std::cout << "The paths are the same." << std::endl;
    } else {
        std::cout << "The paths are different." << std::endl;
    }
 
    return 0;
}

std::filesystem::equivalent - cppreference.com

相关推荐
十步杀一人_千里不留行3 天前
和 AI 一起修 Bug 心得体会
人工智能·bug·ai编程
花王江不语3 天前
改bug的一些体会
bug
zimoyin3 天前
Linux 程序使用 STDOUT 打印日志导致程序“假死”?一次线上 Bug 的深度排查与解决
linux·运维·bug
城下秋草4 天前
趣谈Bug -500英里邮件问题
bug
初圣魔门首席弟子4 天前
c++中this指针使用bug
前端·c++·bug
张较瘦_4 天前
[论文阅读] AI + 软件工程(Debug)| 告别 “猜 bug”:TreeMind 用 LLM+MCTS 破解 Android 不完整报告复现难题
论文阅读·人工智能·bug
数字芯片实验室5 天前
芯片验证:发现BUG是件好事
bug
南方者5 天前
【JAVA】【BUG】经常出现的典型 bug 及解决办法
java·oracle·bug
十铭忘5 天前
Bug——PaddleX人脸识别报错:Process finished with exit code -1073741819 (0xC0000005)
学习·bug
一勺-_-6 天前
疑问:hfish的一个bug,很奇怪
bug