[Win32utils-devel] Latest win32-file commit

win32utils-devel at rubyforge.org win32utils-devel at rubyforge.org
Thu May 20 10:33:42 EDT 2004


I've committed an alpha version of a win32-file that supports a native
open, close and write.  I've got a couple issues that I was hoping you
could help with.

First, should we overload these methods?  In other words, for the open
method, if it's 1 argument use the default Ruby method, but if it's 5
arguments (the number of arguments that CreateFile() takes, excluding a
security descriptor and a template file) use the native Win32 call.  Or
should we just give them separate names, e.g. nopen, nwrite, nclose?

If we're going to overload, how do we do it?  Rewrite the code using
C++?  That would be fine with me since we're assuming VC++ anyway I

Second, I'm not entirely sure how to handle overlapped IO.  If a user
passes File::OVERLAPPED | File::NO_BUFFERING, should we automagically
pass an overlapped structure to the method?  Or should we decree that
all write operations are asynchronous?  Or perhaps create a separate
"write_async" method that calls WriteFileEx()?

Please let me know your thoughts.



More information about the win32utils-devel mailing list