2017-01-25 10 views
0

私はディレクトリ/asdfを見てlibが通知変えるいくつかのファイルシステムを使用し、asdf内で、I vim tmp、およびファイルVIMを使用してファイルを保存するとどうなりますか?

を保存するために:wqを使用し、いくつかの変更を行い、その後、私はこの出力を得た:

/asdf/4913 at watch.pl line 9. 
/asdf/4913 at watch.pl line 9. 
/asdf/tmp at watch.pl line 9. 
/asdf/tmp at watch.pl line 9. 
/asdf/tmp at watch.pl line 9. 
/asdf/tmp~ at watch.pl line 9. 
/asdf/tmp~ at watch.pl line 9. 

4913ファイルとは何ですか? tmp〜fileとは何ですか? :wqの後にはどうなりますか?

+0

を引き起こしているコードです。エディターXの内部の仕組みを尋ねるのはそのように分類するとは思わない。 – GhostCat

+0

http://vi.stackexchange.com/ –

+0

でこれを試してみてください。すべての自己尊重のウォッチャーは、Vimの「奇妙な」執筆行動に対処するために何か他のことをしています。あなたのウォッチャーはあなたが別のものを探すべきではない。 – romainl

答えて

0

https://github.com/neovim/neovim/issues/3460

から興味深いケースが挙げられた:ネオ/ Vimはディレクトリが書き込み可能であるかどうかを確認し、得られACLを参照するには、一時ファイルを作成します。

したがって、ファイルの変更を監視するソフトウェアを作成している場合、Vimはほぼすべての編集でファイル4913を作成して削除します。 REF

追加の詳細 https://groups.google.com/forum/#!topic/vim_dev/sppdpElxY44
https://vi.stackexchange.com/questions/4038/why-does-set-nocompatible-result-in-vim-saving-extra-all-numeric-temporary-fi

ここでこのサイトには、プログラミングの問題についてですこの

/* 
* Check if we can create a file and set the owner/group to 
* the ones from the original file. 
* First find a file name that doesn't exist yet (use some 
* arbitrary numbers). 
*/ 
STRCPY(IObuff, fname); 
for (i = 4913; ; i += 123) 
{ 
    sprintf((char *)gettail(IObuff), "%d", i); 
    if (mch_lstat((char *)IObuff, &st) < 0) 
     break; 
} 
fd = mch_open((char *)IObuff, 
       O_CREAT|O_WRONLY|O_EXCL|O_NOFOLLOW, perm); 
if (fd < 0)  /* can't write in directory */ 
    backup_copy = TRUE; 
else 
{ 

    ignored = fchown(fd, st_old.st_uid, st_old.st_gid); 
    if (mch_stat((char *)IObuff, &st) < 0 
     || st.st_uid != st_old.st_uid 
     || st.st_gid != st_old.st_gid 
     || (long)st.st_mode != perm) 
    backup_copy = TRUE; 
    /* Close the file before removing it, on MS-Windows we 
    * can't delete an open file. */ 
    close(fd); 
    mch_remove(IObuff); 
関連する問題