On Thursday, March 10, 2016 at 10:00:02 AM UTC+9, Ken Takata wrote:
> Hi mattn,
> 
> 2016/3/10 Thu 4:56:10 UTC+9 Bram Moolenaar wrote:
> > Patch 7.4.1526
> > Problem:    Writing to file and not connecting a channel doesn't work for
> >             MS-Windows.
> > Solution:   Make it work. (Yasuhiro Matsumoto)
> > Files:      src/os_win32.c, src/testdir/test_channel.vim
> 
> 
> > --- 5046,5109 ----
> >       {
> >     char_u *fname = options->jo_io_name[PART_IN];
> >   
> > !   int fd = mch_open((char *)fname, O_RDONLY, 0);
> > !   if (fd < 0)
> >     {
> >         EMSG2(_(e_notopen), fname);
> >         goto failed;
> >     }
> > +   ifd[0] = (HANDLE)_get_osfhandle(fd);
> >       }
> 
> In this block, "fd" leaks.
> Maybe there are two solutions:
> 
> 1. Duplicate the handle ifd[0] then close fd.
> 2. Make a new function equivalent to CreateFile() but take a filename with
>    "char_u *".
> 
> 
> Regards,
> Ken Takata

Thanks. I figured out why job_io_file_open() did fail. To read the Xportnr from 
python, it require FILE_SHARE_READ too even though it use GENERIC_WRITE.

https://gist.github.com/mattn/18a54e3c61b720f2e8f9

- mattn

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui