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. 一些意外bug

    2024-07-13 13:28:03       63 阅读
  2. 由于bug发现现象

    2024-07-13 13:28:03       35 阅读
  3. element-uibug记录

    2024-07-13 13:28:03       24 阅读
  4. 在数据库造数据发现bug也是bug

    2024-07-13 13:28:03       53 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 13:28:03       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 13:28:03       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 13:28:03       57 阅读
  4. Python语言-面向对象

    2024-07-13 13:28:03       68 阅读

热门阅读

  1. 【Android】在渲染生效前提前测量View大小

    2024-07-13 13:28:03       22 阅读
  2. 基于节点嵌入的链接预测(暂时这样吧)

    2024-07-13 13:28:03       19 阅读
  3. C#中where的约束

    2024-07-13 13:28:03       22 阅读
  4. ABP框架中的ISoftDelete与软删除

    2024-07-13 13:28:03       24 阅读
  5. 三级_网络技术_13_局域网技术基础及应用

    2024-07-13 13:28:03       22 阅读
  6. 服务器数据出现丢失该怎样恢复?

    2024-07-13 13:28:03       17 阅读
  7. React中使用usePrevious的意义是什么,为啥要用它

    2024-07-13 13:28:03       18 阅读
  8. Spring:SpringBoot为什么可以使用Jar包启动

    2024-07-13 13:28:03       18 阅读
  9. ubuntu安装k8s+docker运行英伟达gpu cuda

    2024-07-13 13:28:03       22 阅读
  10. 使用Python绘制百分比堆积柱形图

    2024-07-13 13:28:03       21 阅读
  11. Memcached负载均衡:揭秘高效缓存分发策略

    2024-07-13 13:28:03       21 阅读
  12. Mybatis-SQL注入讲解及#预处理与$的区别

    2024-07-13 13:28:03       19 阅读