macOS – Understanding `._xxx` Files in macOS

filemacos

I created a index.php file under my phplessons directory:

enter image description here

before I used the phpStorm to open the directory, Apple's Text Editor opened it, now I have phpStorm open, but there is a ._index.php file alongside index.php file.

I don't know what's the ._index.php file is, but in it I find a string com.apple.TextEncoding.

What is this file and what is its purpose?

Best Answer

It's simply a temporary metadata file created by TextEdit app. You can safely ignore it.

File beginning with . are hidden files in macOS. Files beginning with ._ are metadata files created by apps in macOS.

If you do not wish to be bothered by such files, it's better to add it in your version control ignore rules (if you use one).