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

59540Re: windows bug: filewritable() returns 0 if we use it on the current script being read

Expand Messages
  • Ben Fritz
    Nov 3, 2010
      On Nov 2, 7:21 am, Philippe Vaucher <philippe.vauc...@...>
      > Hello,
      > I think I've found a bug for vim under windows.
      > Basically if inside a vim script you do
      > "filewritable(expand('<sfile>'))" it returns 0 even if the file is
      > writable.
      > I read the source and basically it boils down to that the dwShareMode
      > param of CreateFile() is 0, when it should be FILE_SHARE_READ|
      >   hFile = CreateFileW(wn, am, 0, NULL, OPEN_EXISTING, 0, NULL);
      > I'm not sure of the implications, but basically I think just changing
      > the dwShareMode param to the correct value everywhere CreateFile() is
      > used should fix it. Not that in certain places it's used with the
      > correct flag value.

      I'm pretty sure you nomally WANT to lock a file from being written,
      while you are executing its contents as a script. It sounds like this
      is what is happening. Is there some reason you want to write the file
      while executing it?

      You received this message from the "vim_dev" 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
    • Show all 16 messages in this topic