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

相关推荐
阿奇__7 小时前
el-table有固定列时样式bug
vue.js·elementui·bug
残花月伴2 天前
天机学堂——day1(修改bug)
servlet·bug
std860212 天前
微软 Win11 经典版 Outlook 曝 BUG,加速 SSD 损耗
microsoft·bug·outlook
花花鱼2 天前
android 网络访问拦截器使用后的bug处理
bug
JH30732 天前
MyBatis多表联查返回List仅一条数据?主键冲突BUG排查与解决
bug·mybatis
约翰先森不喝酒3 天前
Android BUG 之 资源文件报红但不影响运行
bug
百花~3 天前
认识BUG~
bug
ZHE|张恒3 天前
RDP 远程桌面连接:浏览器无法获取摄像头
bug
chde2Wang3 天前
Linux中bash: ls: 未找到命令… 相似命令是: ‘lz‘
linux·运维·bug·bash
阿里巴巴淘系技术团队官网博客3 天前
让AI打出丝滑连招:编码-部署-自测-改bug
人工智能·bug