模拟不区分大小写的文件系统的区分大小写 [英] Simulating case sensitivity on a filesystem that isn't case sensitive

查看:326
本文介绍了模拟不区分大小写的文件系统的区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在不区分大小写的文件系统上使用C ++开发时,我会想到一些问题,例如

When I develop in C++ on a filesystem that is not case sensitive, I miss problems such as

#include "File.h"

如果在磁盘上实际上是 file.h

if on disk it is actually file.h.

问题只出现在我最终尝试在区分大小写的文件系统上编译代码时。

The problem only appears when I eventually try to compile the code on a case sensitive filesystem.

如何在不区分大小写的文件系统(例如OSX的默认值)上模拟区分大小写?

How do I simulate case sensitivity on a filesystem (such as OSX's default) that isn't case sensitive?

编辑:
我正在寻找一个自动化的解决方案,我可以运行现在和未来与按下一个按钮。

I am looking for an automated solution, one that I can run now and in the future with "the push of a button".

它也似乎是完全好的风格,严格命名文件在C ++中的类的确切名称后,包括case。所以SuperDuperClass将出现在SuperDuperClass.h中。

It also appears to be perfectly good style to rigorously name files in C++ after the exact name of the class, including case. So SuperDuperClass would appear in SuperDuperClass.h. A solution that requires lowercasing filenames is not suitable.

推荐答案

在Mac OS X上,您可以使用磁盘工具创建一个case-

On Mac OS X, you can use Disk Utility to create a case-sensitive file system on a disk image.

这篇关于模拟不区分大小写的文件系统的区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆