Mac 下的那些垃圾文件

2015-05-30 09:21:33 +08:00
 whatisnew

最近用 smb 做一些事情,发现 mac 自动生成一些垃圾文件,

每个目录产生:

.DS_Store
_.DS_Store
._.DS_Store

每个文件产生:

.file_name.txt
._file_name.txt
._.file_name.txt

我操。。。太恶心了,试了各种方法,不能禁止。

3493 次点击
所在节点    macOS
21 条回复
wohenyingyu01
2015-05-30 09:25:25 +08:00
目录产生的是要记录这个目录下文件的显示位置的,文件产生的是你中病毒了吧我怎么没看见过,还txt
whatisnew
2015-05-30 09:26:47 +08:00
@wohenyingyu01 那个 .txt 是自己新建的文件,你新建一个 doc.txt 他会自动生成相对应的隐藏文件
pH
2015-05-30 09:29:46 +08:00
请问楼主如何定义垃圾文件。 是否你不需要的就是垃圾文件呢?
wohenyingyu01
2015-05-30 09:32:18 +08:00
@whatisnew 那是因为texteditor的自动保存功能吧?你用word开doc也有啊,这些都是可以关闭的,但是方法不记得了
lostarray
2015-05-30 09:32:43 +08:00
正常情况应该只有.DS_Store一个文件,其他的应该是你系统出问题了
zhouzm
2015-05-30 10:21:59 +08:00
Asepsis( http://asepsis.binaryage.com )专治这个
whatisnew
2015-05-30 10:32:52 +08:00
@zhouzm 我看他说只治 .DS_Store 文件啊,那些 ._. 之类的文件呢。。。
philobscur
2015-05-30 11:01:02 +08:00
@whatisnew ._. 为什么看着很萌的样子...
jsfaint
2015-05-30 11:13:07 +08:00
> .file_name.txt
> ._file_name.txt
> ._.file_name.txt

这些文件我这边在优盘,移动硬盘(非hfs+)或者network storage上面会出现。
asepsis应该是只能治.DS_Store
whatisnew
2015-05-30 11:15:09 +08:00
@jsfaint 是啊,用的 samba 所以会有那些 ._. 的文件
jsfaint
2015-05-30 11:20:49 +08:00
@whatisnew 优盘,移动硬盘可以用cleanmydrive清理,samba不知道怎么搞了……
046569
2015-05-30 12:33:41 +08:00
可以试试 TinkerTool ,貌似可以解决 LZ 的问题.
dotpig
2015-05-30 12:44:41 +08:00
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
whatisnew
2015-05-30 12:45:31 +08:00
@dotpig only for ds_store
dotpig
2015-05-30 12:49:08 +08:00
@whatisnew ._, ._. are loop copies of .DS_Store. Once you get rid of .DS_Store, you get rid of the others. At least that's how I keep my NAS shares clean.
dotpig
2015-05-30 12:55:45 +08:00
@whatisnew 不好意思,你指的是 ._.file_name.txt 这些文件是吧?用这个叫 CleanUp smb mess 的:
http://faqintosh.com/risorse/en/sys/cleansmb/
我没用过。关于解释,看到这个:
The ._FILE files are used to store resource fork data on filesystems that do not support files with multiple forks. Most modern Mac applications do use the resource fork at all; if they want to store metadata, they'll most likely use extended attributes.
whatisnew
2015-05-30 12:56:14 +08:00
@dotpig 我把 DSDontWriteNetworkStores true 了,它不会产生 .ds_store 文件了,但是会产生 ._.ds_store 文件,然后,每一个文件另外再产生 . ._ ._. 这3个文件
feikaras
2015-05-30 20:53:56 +08:00
@jsfaint 估计因为你的文件有附加属性?这个怎么关我没看过。
记得非HFS+上附加属性通过的额外文件,是不是这个文件名我忘了。

比如文件从哪里下载的这种就算附加属性。
feikaras
2015-05-30 20:54:48 +08:00
附加属性生成的文件的话,用finder拷贝回去的时候会自动合并进HFS的样子。。不过确实好烦人。
jsfaint
2015-06-01 08:53:02 +08:00
@feikaras 是的,就是一些附加属性。非hfs+根本不需要这些,略显蛋疼

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/194835

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX