What is the .empty file for?

喜夏-厌秋 提交于 2021-02-20 19:31:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!