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

相关推荐
hadage23323 分钟前
windows alt + tab 切换窗口时会强制把我的中文键盘的中英文输入改为中文这个bug的曲线救国方式 da
bug
烧酒同学16 小时前
【Qt】QScrollArea的滑动条无法拖动(已解决)
qt·bug
黎雁·泠崖1 天前
VS2022调试通关秘籍:变量跟踪+内存分析+bug定位
c语言·bug
切糕师学AI1 天前
海森堡Bug是什么?
bug
xplidelphi1 天前
Python安装遇到的Bug
开发语言·python·bug
程序员杰哥1 天前
快速定位bug,编写测试用例
自动化测试·软件测试·python·功能测试·测试工具·测试用例·bug
Jay Kay4 天前
Event loop is closed when AsyncClient exists in multiple event_loops.
bug
JHC0000005 天前
发现个微信客户端的bug
微信·bug
wow_DG8 天前
【Python✨】VS Code 秒开 Python 类型检查:一招 mypy + settings.json 让你的 Bug 原地现形!
python·json·bug
驱动探索者10 天前
Zephyr 获取 cpu 占用率异常bug分析
bug·rtos·zephyr