问题
I've recently come across a situation when an "empty" folder used by an application contains a .empty
file. For example, an application has a folder for logs, and when there are no logs yet, this folder contains a .empty
file. Even when there already are log files, this file isn't deleted.
I've opened the file, and it is empty, so I assume it contains no useful information except that the file itself is present.
What's the purpose of this empty file?
P.S. My only guess is that this file is created by the application when it runs for the first time to check if it has enough permissions.
回答1:
Developer will add a ".empty" file to a folder, when its initially empty. So that will guarantee that the folder is included to git / svn etc. Normally they will exclude empty folders.
来源:https://stackoverflow.com/questions/15083542/what-is-the-empty-file-for