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

相关推荐
天才测试猿1 天前
快速定位bug,编写测试用例
自动化测试·软件测试·功能测试·测试工具·职场和发展·测试用例·bug
福大大架构师每日一题2 天前
PyTorch v2.9.1 发布:重要 Bug 修复与性能优化详解
人工智能·pytorch·bug
黑臂麒麟2 天前
Electron&OpenHarmony 跨平台实战开发(bug):npm 安装 Electron 依赖常见错误排查
electron·npm·bug·openharmony
CIb0la2 天前
Complete Bug Bounty tool List for free
linux·运维·bug
欧恩意2 天前
【Viusal Studio】关于增量链接机制
汇编·windows·bug
Austindatabases2 天前
SQLite 开发中的数据库开发规范 --如何提升业务系统性能避免基础BUG
数据库·oracle·sqlite·bug·数据库开发
万粉变现经纪人3 天前
如何解决 pip install 代理报错 407 Proxy Authentication Required 问题
windows·python·pycharm·beautifulsoup·bug·pandas·pip
爱尔兰极光3 天前
软件测试--BUG篇
bug·压力测试·测试
hadage2333 天前
windows alt + tab 切换窗口时会强制把我的中文键盘的中英文输入改为中文这个bug的曲线救国方式 da
bug
烧酒同学4 天前
【Qt】QScrollArea的滑动条无法拖动(已解决)
qt·bug