Re: [vimdev] Again, 'filewriteable' function added (patch against 6.0n)
- Bram Moolenaar <Bram@...> writes:
>All right. I'll make the changes. However, I will make it return:
>I can understand you want some kind of filewritable(). But once the function
>is there, and it doesn't do what users expect, I get asked to improve it.
>That's how it always goes. So I only want to add a filewritable() function
>- it works on all systems (use the code in readfile() for this)
>- when the file doesn't exist, it checks if the file can be created (test
> writability of the directory)
>- there are proper docs
0 - file not writeable
1 - file exists and is writeable
2 - file doesn't exists but could be created (and written)
Because I, at least, need to distinguish between a pre-existing file and the
simple ability to write somewhere.
I'll also redo the docs to indicate this.
>> a buffer? At the worst, it will be no more incorrect than vim already is inWill do.
>> that instance?!?
>That's right. When using the same code as in readfile() it should work good