.empty文件有什么用? [英] What is the .empty file for?

查看:136
本文介绍了.empty文件有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到一种情况,应用程序使用的空"文件夹包含一个 .empty 文件.例如,一个应用程序有一个用于日志的文件夹,而当尚无日志时,该文件夹包含一个 .empty 文件.即使已经有日志文件,也不会删除该文件.

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.我唯一的猜测是,该文件是在首次运行时由应用程序创建的,以检查其是否具有足够的权限.

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.

推荐答案

在最初为空时,Developer会将".empty"文件添加到文件夹中.这样可以确保该文件夹包含在git/svn等文件中.通常,它们将排除空文件夹.

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.

这篇关于.empty文件有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆