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 天前
DataV轮播时其他组件的内容也一起滚动 修复bug的方法
前端·vue.js·bug·大屏端
桃子丫1 天前
AD转 Cadence学习指南-BUG篇
bug
testtraveler1 天前
[Fix] ImportError: libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
pytorch·python·bug
测试者家园1 天前
从“找 bug”到“降风险”:测试思维模式的底层迁移
软件测试·bug·风险管理·持续测试·测试基础·智能化测试·测试思维模式
chde2Wang2 天前
运行scala文件报错xsbt.CompilerInterface
bug·scala
离离茶3 天前
【笔记1-8】Qt bug记录:QListWidget窗口的浏览模式切换为ListMode后,滚轮滚动速度变慢
笔记·qt·bug
程序猿阿伟3 天前
《从被动修复到免疫:游戏Bug闭环体系的深度搭建指南》
游戏·bug
Cola可洛6 天前
修复Flyme移植BUG
android·bug
Bear on Toilet6 天前
C++_Bug:现代写法拷贝构造中 swap 写法之小坑
数据结构·c++·bug
aduzhe6 天前
关于在嵌入式中打印float类型遇到的bug
前端·javascript·bug