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

相关推荐
猫猫头有亿点炸20 小时前
电脑连不上手机热点会出现的小bug
bug
不想加班的码小牛2 天前
第4期:重构软件测试体系——生成式AI如何让BUG无所遁形
人工智能·重构·bug·集成测试
limanjihe2 天前
PrimeTime生成.lib竟暗藏PG添加Bug
bug
Java手札4 天前
【bug】Cannot connect to already running IDE instance.SocketTimeoutException
ide·bug
妄想出头的工业炼药师4 天前
pcl 1.14.1 vs2022 Eigen::internal::aligned_free bug
bug
小海海不怕困难4 天前
xxljob阻塞处理策略设置为单机串行导致的bug
bug
Littlehero_1214 天前
关于bug总结记录
bug
深度Linux5 天前
告别代码Bug,GDB调试工具详解
linux内核·bug·内核调试
UQI-LIUWJ5 天前
debug 笔记:llama 3.2 部署bug 之cutlassF: no kernel found to launch!
笔记·bug·llama
公诚士6 天前
【bug】微信小程序了,在开发中遇到的2个问题
微信小程序·小程序·bug