0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

mac のファイルシステムは大文字小文字を区別しない

Last updated at Posted at 2021-12-05

APFS で, 大文字小文字が区別されない.
docker volume sync, tar file での動作を軽く検証する.

以下の様な動作になり、びっくり

$ pwd
/

$ PWD
/

$ pWd
/
$ which echo
/bin/echo

$ which Echo
/bin/Echo

$ which ECHO
/bin/ECHO

$ WHICH ECHO
/bin/ECHO
$ touch abcd
$ ls
abcd

$ touch ABCD
$ ls
abcd

docker volumen sync した場合

docker for mac で、volumen 同期し, container 内で file を作成してみる.
結果は、mac の動作と同様に, 大文字小文字を考慮せず, 同じ file として扱われる

[root@9f0e9d28a78d current]# touch a
[root@9f0e9d28a78d current]# ls
a

[root@9f0e9d28a78d current]# touch A
[root@9f0e9d28a78d current]# ls
a

volume 同期していない dir 内では大文字小文字は区別された

[root@9f0e9d28a78d test]# touch a
[root@9f0e9d28a78d test]# ls
a

[root@9f0e9d28a78d test]# touch A
[root@9f0e9d28a78d test]# ls
A  a

tar file を解凍した場合は?

tar file の中身は以下

 drwxr-xr-x   0 ./tmp/
 -rw-r--r--   2 ./tmp/A
 -rw-r--r--   2 ./tmp/a

結果, 片方の file は消滅する

$ tar zxvf tmp.tar.gz
x ./tmp/
x ./tmp/A
x ./tmp/a

$ ls tmp
a

怖いですね

git は試していないが, 同様の動作をすると仮定すると, 惑わされる事がでてきそうですね.

怖や怖や

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?