On Sa, 28 Aug 2010, Aaron Lewis wrote:
> Is there any commands can be used to check if a file exists ?
> command `exists` seems to be function related.
>
> I could not open this thread "Re: check if a file exists in vim script"
> on mail-archive.com" in browser .. so plz help.
There are several functions, you can use. One would be something like
this:
if filereadable('c:/foobar')
... " do whatever you want
endif
And if you don't care, if the file is actually readable, use glob
instead of filereadable() and to check whether the file is a directory,
use an isdirectory() call.
:h glob()
:h filereadable()
:h isdirectory()
regards,
Christian
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment