0
如果我用下面的內容創建一個文件test.vim
並運行:so %
然後filereadable
返回true,並且foo,bar被追加到文件中。Vim filereadable對用戶腳本返回true,對插件返回false
let lines = ["foo", "bar"]
let g:neobundle#log_filename=expand('~/.vim/plugin_install.log')
if filereadable(g:neobundle#log_filename)
let lines = readfile(g:neobundle#log_filename) + lines
endif
call writefile(lines, g:neobundle#log_filename)
但是,如果我從neobundle.vim運行完全相同的代碼(代碼突出here)然後filereadable
返回false,並且文件被覆蓋。即使我chmod 777
的文件。
什麼可能導致這種filereadable
行爲的變化,我該如何解決?
謝謝!我打開了一個pull請求來清除日誌文件可選https://github.com/Shougo/neobundle.vim/pull/47 –