更新时间:2022-05-11 16:59:25
如果您已经在使用 stat(2)
,那么您可以轻松使用 pathconf(2)
带有 _PC_CASE_SENSITIVE
选择器(结果 0
= 不区分大小写,1
= 区分大小写.请注意,手册页已过期,但 >_PC_CASE_SENSITIVE
和 _PC_CASE_PRESERVING
被支持.按照惯例,如果文件系统不支持 _PC_CASE_SENSITIVE
选择器,那么它是区分大小写的.
If you're already using stat(2)
, then you can easily use pathconf(2)
with the _PC_CASE_SENSITIVE
selector (result 0
= case-insensitve, 1
= case-sensitive. Note that the man page is out of date, but the _PC_CASE_SENSITIVE
and _PC_CASE_PRESERVING
are supported. By convention, if a file system doesn't support _PC_CASE_SENSITIVE
selector then it is case-sensitive.