V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
whatisnew
V2EX  ›  macOS

Mac 下的那些垃圾文件

  •  
  •   whatisnew · 2015-05-30 09:21:33 +08:00 · 3486 次点击
    这是一个创建于 3269 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    每个目录产生:

    .DS_Store
    _.DS_Store
    ._.DS_Store
    

    每个文件产生:

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

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

    21 条回复    2015-06-01 09:05:23 +08:00
    wohenyingyu01
        1
    wohenyingyu01  
       2015-05-30 09:25:25 +08:00
    目录产生的是要记录这个目录下文件的显示位置的,文件产生的是你中病毒了吧我怎么没看见过,还txt
    whatisnew
        2
    whatisnew  
    OP
       2015-05-30 09:26:47 +08:00
    @wohenyingyu01 那个 .txt 是自己新建的文件,你新建一个 doc.txt 他会自动生成相对应的隐藏文件
    pH
        3
    pH  
       2015-05-30 09:29:46 +08:00
    请问楼主如何定义垃圾文件。 是否你不需要的就是垃圾文件呢?
    wohenyingyu01
        4
    wohenyingyu01  
       2015-05-30 09:32:18 +08:00
    @whatisnew 那是因为texteditor的自动保存功能吧?你用word开doc也有啊,这些都是可以关闭的,但是方法不记得了
    lostarray
        5
    lostarray  
       2015-05-30 09:32:43 +08:00 via iPhone
    正常情况应该只有.DS_Store一个文件,其他的应该是你系统出问题了
    zhouzm
        6
    zhouzm  
       2015-05-30 10:21:59 +08:00   ❤️ 1
    Asepsis( http://asepsis.binaryage.com )专治这个
    whatisnew
        7
    whatisnew  
    OP
       2015-05-30 10:32:52 +08:00
    @zhouzm 我看他说只治 .DS_Store 文件啊,那些 ._. 之类的文件呢。。。
    philobscur
        8
    philobscur  
       2015-05-30 11:01:02 +08:00
    @whatisnew ._. 为什么看着很萌的样子...
    jsfaint
        9
    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
        10
    whatisnew  
    OP
       2015-05-30 11:15:09 +08:00
    @jsfaint 是啊,用的 samba 所以会有那些 ._. 的文件
    jsfaint
        11
    jsfaint  
       2015-05-30 11:20:49 +08:00
    @whatisnew 优盘,移动硬盘可以用cleanmydrive清理,samba不知道怎么搞了……
    046569
        12
    046569  
       2015-05-30 12:33:41 +08:00
    可以试试 TinkerTool ,貌似可以解决 LZ 的问题.
    dotpig
        13
    dotpig  
       2015-05-30 12:44:41 +08:00
    defaults write com.apple.desktopservices DSDontWriteNetworkStores true
    whatisnew
        14
    whatisnew  
    OP
       2015-05-30 12:45:31 +08:00
    @dotpig only for ds_store
    dotpig
        15
    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
        16
    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
        17
    whatisnew  
    OP
       2015-05-30 12:56:14 +08:00
    @dotpig 我把 DSDontWriteNetworkStores true 了,它不会产生 .ds_store 文件了,但是会产生 ._.ds_store 文件,然后,每一个文件另外再产生 . ._ ._. 这3个文件
    feikaras
        18
    feikaras  
       2015-05-30 20:53:56 +08:00
    @jsfaint 估计因为你的文件有附加属性?这个怎么关我没看过。
    记得非HFS+上附加属性通过的额外文件,是不是这个文件名我忘了。

    比如文件从哪里下载的这种就算附加属性。
    feikaras
        19
    feikaras  
       2015-05-30 20:54:48 +08:00
    附加属性生成的文件的话,用finder拷贝回去的时候会自动合并进HFS的样子。。不过确实好烦人。
    jsfaint
        20
    jsfaint  
       2015-06-01 08:53:02 +08:00
    @feikaras 是的,就是一些附加属性。非hfs+根本不需要这些,略显蛋疼
    arkilis
        21
    arkilis  
       2015-06-01 09:05:23 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2194 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:24 · PVG 08:24 · LAX 17:24 · JFK 20:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.