Hi,

When I was trying to fix the encryption problem(*1), I found that the win32
implementation uses dup() and close() to flush a file(*2).

(*1) https://groups.google.com/d/topic/vim_dev/gYYZV6pp0hs/discussion

(*2) https://github.com/vim/vim/blob/v7.4.977/src/memfile.c#L661-L666
>       /*
>        * Win32 is a bit more work: Duplicate the file handle and close it.
>        * This should flush the file to disk.
>        */
>       if ((fd = dup(mfp->mf_fd)) >= 0)
>           close(fd);

Actually, there is _commit() function for this purpose.
https://msdn.microsoft.com/en-us/library/17618685.aspx

Is there any (historical?) reason that _commit() is not used?
Isn't it better to use _commit() instead of dup() and close()?

Regards,
Ken Takata

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