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

相关推荐
2601_967987372 天前
程序员遇到BUG的解释
程序员·bug·软件开发·调试·幽默
jianqiang.xue2 天前
线程一切换浮点全作废:五天修好的隐秘bug
bug
寂寞的船5 天前
【Unity Bug挑战】第12期 Awaitable 二次 await 死锁之谜 —— 为什么同一个异步操作等两次就卡死?
unity·c#·游戏引擎·bug
海拥✘6 天前
让 AI 修 AI 平台自己的 Bug:我用 SoduWork 给 SoduWork 提了一个 PR
人工智能·bug
Risehuxyc9 天前
fix bug
bug
拖累斯11 天前
Jenkins + Python 全自动跑通「禅道任务/BUG 导出 → 月度开发考核表」
python·jenkins·bug
寂寞的船12 天前
【Unity Bug挑战】第10期 SerializeReference 内存泄漏之谜
unity·c#·游戏引擎·bug
unity工具人12 天前
unity 照片墙插件(Pop-up Photo Wall)在触摸屏和红外框设备上的触发Bug
bug
灼行15 天前
Autosar SecOC 需求场景BUG(需求不一致性)【草稿】
bug
小豆庄17 天前
视频遮罩追踪退场后ID撞号的排查—多目标场景下的失效
opencv·算法·bug·视频·python3.11