If I create a file test.vim with the below contents and run :so % then filereadable return true and foo, bar is appended to the file.
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)
But if I run the exact same code from neobundle.vim (code highlighted here) then filereadable return false and the file is overwritten. Even if I chmod 777 the file.
What could be causing this change in behavior of filereadable and how can I fix it?
The log of neobundle is cleared before installing. (code is here)