0
1

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 のテキストエディット.app はハードリンクを壊す

0
Posted at

macOS のテキストエディット.app を使ってハードリンクのファイルを編集・保存すると、inode が別のファイルとして保存される。

詳細

a.txt を作成し、ハードリンク b.txt を作成する。

% echo "test" > a.txt
% ln a.txt b.txt
% ls -i
7972329 a.txt	7972329 b.txt

この状態でテキストエディット.appb.txt を開いて編集し保存すると inode が別なファイルとして保存される。

% ls -i
7972329 a.txt	7972381 b.txt

システム的な制限というわけではなくテキストエディット.app の問題のようで、VS Code で編集した場合はハードリンクは壊れないし、当然 vi などで編集しても壊れない。

なお、シンボリックリンクの場合にはテキストエディット.app で編集しても壊れない。

0
1
4

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?