Philippe Vaucher wrote:

> 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|
> FILE_SHARE_WRITE:
> 
>   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.

It makes sense, but we must make sure this does not cause any trouble.
Does it work on all Windows versions?

On Unix we never care about others having the file open, thus I don't
see a reason to check for that on MS-Windows.

-- 
Q: How do you tell the difference between a female cat and a male cat?
A: You ask it a question and if HE answers, it's a male but, if SHE
   answers, it's a female.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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

Raspunde prin e-mail lui