Loading ...
Sorry, an error occurred while loading the content.
 

Re: [vimdev] Again, 'filewriteable' function added (patch against 6.0n)

Expand Messages
  • Ron Aaron
    ... All right. I ll make the changes. However, I will make it return: 0 - file not writeable 1 - file exists and is writeable 2 - file doesn t exists but
    Message 1 of 26 , Nov 28, 2000
      Bram Moolenaar <Bram@...> writes:
      >
      >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
      >when:
      >- 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

      All right. I'll make the changes. However, I will make it return:

      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 in
      >> that instance?!?
      >
      >That's right. When using the same code as in readfile() it should work good
      >enough.

      Will do.

      Ron
    Your message has been successfully submitted and would be delivered to recipients shortly.