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

相关推荐
数字芯片实验室36 分钟前
仿真器出bug了?分频时钟竞争的诡异仿真现象
fpga开发·bug
Zsh-cs3 小时前
苍穹外卖day9前端订单分页查询后订单菜品不展示(已解决)
bug
北数云1 天前
北数云内测|AI 需求发布区 + Bug/建议长期征
bug·模型·智能体
天上掉下个牛霸天2 天前
Bug悬案:技术侦探如何破案
bug
f***24112 天前
Bug悬案:程序员破案指南
bug
e***98572 天前
Bug破案现场:技术团队的悬疑推理秀
bug
数字芯片实验室2 天前
边界值测试:一个”==”引发的芯片bug
fpga开发·bug
e***98573 天前
Bug悬案侦破大会:高效解决技术难题
bug
f***24113 天前
Bug悬案侦破:技术团队的破案指南
bug
Lxinccode3 天前
BUG(20) : response.text耗时很久, linux耗时十几秒, Windows耗时零点几秒
python·bug·requests·response.text·response.text慢