如何防止._(点下划线)文件?

时间:2014-02-17 09:29:21

标签: sshfs textmate2

我正在使用Textmate 2通过sshfs在远程Linux服务器上编辑rails项目。

当我保存文件(例如README.rdoc)时,会创建另一个文件(例如._README.rdoc):

-rw-rw-r--  1  4096 Feb 17 17:19 ._README.rdoc
-rw-rw-r--  1   486 Feb 17 17:19 README.rdoc

Textmate文档提到how to disable extended attributes

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1

但在上述._之后仍然会创建defaults write个文件。

使用sshfs + Textmate 2时,有没有办法禁用._文件的创建?

2 个答案:

答案 0 :(得分:4)

在Textmate 2中

To disable Extended Attributes,使用:

defaults write com.macromates.TextMate.preview volumeSettings '{ "/Users/ohho/Mount/" = { extendedAttributes = 0; }; }'

/Users/ohho/Mount/是我所有sshfs挂载文件夹的父文件夹。

答案 1 :(得分:0)

正如我尝试使用以下命令这不起作用:     不工作: - “默认写com.macromates.textmate OakDocumentDisableFSMetaData 1”

I have taken reference from : 

https://github.com/textmate/textmate/wiki/Hidden-Settings 现在工作正常。

TextMate use extended attributes to store caret position, etc.

On file systems which don’t support extended attributes 

(大多数网络文件系统),OS X将创建一个辅助文件 点下划线前缀(例如._filename)。

If you don’t want these files, you can disable the use of extended 

属性。目前使用volumeSettings键控制。 它的值是(1)带路径前缀的关联数组; (2)另一个具有该路径设置的关联数组。 (目前,只有extendedAttributes  得到支持。)

So, if we wanted to disable extended attributes for files under /net/:

默认写入com.macromates.TextMate.preview volumeSettings'{“/ net /”= {extendedAttributes = 0; }; }“