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

相关推荐
itmigrate1 天前
异步请求竞态,藏在页面渲染里的隐形bug
bug
今夕资源网2 天前
OmniVoice 今夕整合包 本地语音TTS断网可用 修复了一些BUG 优化生成速度 极速秒生成
bug·语音克隆·omnivoice·断网可用·本地语音tts·语音tts
烧烧的酒0.o6 天前
Codex桌面版更新后不能使用最新模型问题-排查修复总结
chatgpt·bug
sg_knight7 天前
ZCode Bug 定位实战:把报错丢给 ZCode,它是怎么修的
llm·bug·agent·ai编程·glm·智谱·zcode
轩轶子8 天前
Python CLI Todo:一次数据结构错误引发的 Bug
数据结构·python·bug
鬼手点金8 天前
Claude Code示范案例-修复 Bug 工作流
java·服务器·前端·javascript·bug·openclaw
^Rocky17 天前
IT 疑难杂症诊疗室:复杂技术问题解决实录
运维·bug
Keven_1119 天前
Bug:UVA816
bug
Keven_1119 天前
Bug:UVA1103
bug
钱栈up20 天前
坯料管理导入功能bug修复:只改前端一个文件就解决问题
前端·bug