2014-09-20 87 views
0

有人可以解釋一下,爲什麼OS X創建了._文件? 當我將文件複製到另一個文件夾中時,一切正常,但此外還創建了以._開頭的文件。例如: 我複製movie.mp4到另一個空文件夾中,我得到複製完成後,兩個文件:OS X以._開頭的文件。

._movie.mp4 (size approx.: 4kb) 
movie.mp4 (same size as the original movie.mp4) 

是否有辦法防止OS X這樣做? 因爲我正在處理一些隱藏文件,所以看到它們很重要。但文件._令人不安。

+1

爲了利益,爲什麼這個問題downvoted(-3)...看起來確定...任何特殊原因? – Ben 2016-10-13 11:27:06

回答

1

._[filename]文件是給定文件的擴展屬性。從HFS格式的磁盤複製到非HFS磁盤(如FAT)時,它們通常創建

可以使用dot_clean實用遞歸合併它們放回文件(並刪除它們)在OS 10.5+

假設我們有一個HFS +捲上這4個.PDF文件(和.DS_Store文件):

$ ls -la 
total 18672 
[email protected] 7 andrew staff  238 Sep 17 17:00 . 
[email protected] 10 andrew staff  340 Sep 17 16:51 .. 
[email protected] 1 andrew staff  6148 Sep 17 17:00 .DS_Store 
[email protected] 1 andrew staff 2321922 Mar 1 2010 P01.PDF 
[email protected] 1 andrew staff 2200305 Mar 1 2010 P02.PDF 
[email protected] 1 andrew staff 2416249 Mar 1 2010 P03.PDF 
[email protected] 1 andrew staff 2608839 Mar 1 2010 P04.PDF 

如今這些文件複製(拖放)到FAT32 U盤和做一個ls

$ ls -la 
total 18976 
[email protected] 1 andrew staff 16384 Sep 17 17:00 . 
[email protected] 1 andrew staff 16384 Sep 17 17:00 .. 
[email protected] 1 andrew staff  6148 Sep 17 17:00 .DS_Store 
-rwxrwxrwx 1 andrew staff  4096 Sep 17 17:00 ._.DS_Store 
-rwxrwxrwx 1 andrew staff  4096 Sep 17 17:00 ._P01.PDF 
-rwxrwxrwx 1 andrew staff  4096 Sep 17 17:00 ._P02.PDF 
-rwxrwxrwx 1 andrew staff  4096 Sep 17 17:00 ._P03.PDF 
-rwxrwxrwx 1 andrew staff  4096 Sep 17 17:00 ._P04.PDF 
[email protected] 1 andrew staff 2321922 Mar 1 2010 P01.PDF 
[email protected] 1 andrew staff 2200305 Mar 1 2010 P02.PDF 
[email protected] 1 andrew staff 2416249 Mar 1 2010 P03.PDF 
[email protected] 1 andrew staff 2608839 Mar 1 2010 P04.PDF 

您可以運行dot_clean的屬性合併到指定的文件:

$ dot_clean . 
$ ls -la 
total 18816 
[email protected] 1 andrew staff 16384 Sep 17 17:04 . 
[email protected] 1 andrew staff 16384 Sep 17 17:00 .. 
-rwxrwxrwx 1 andrew staff  6148 Sep 17 17:00 .DS_Store 
-rwxrwxrwx 1 andrew staff 2321922 Mar 1 2010 P01.PDF 
-rwxrwxrwx 1 andrew staff 2200305 Mar 1 2010 P02.PDF 
-rwxrwxrwx 1 andrew staff 2416249 Mar 1 2010 P03.PDF 
-rwxrwxrwx 1 andrew staff 2608839 Mar 1 2010 P04.PDF 

你需要閱讀的目錄和文件/運行訪問顯然做到這一點。

0

這解決了我的問題:

  1. 打開終端。
  2. 執行以下命令:在給用戶

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

  • 要麼重新啓動計算機或註銷並重新account.`