From win32utils-devel at rubyforge.org Mon Nov 1 09:43:32 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 1 09:43:46 2004 Subject: [Win32utils-devel] buffer size for win32-eventlog (was infiniteloop bug...) Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B067@itomae2km07.AD.QINTRA.COM> Thank you very much. :) Dan > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Friday, October 29, 2004 7:12 PM > To: win32utils-devel@rubyforge.org > Subject: Re:[Win32utils-devel] buffer size for win32-eventlog > (was infiniteloop bug...) > > > > Hi, > >>I just noticed the bug is not fixed completely. > >>If run with e.read , the output record number is from 42 > to 2081. If > >>run with e.read(EventLog::SEEK_READ|EventLog::FORWARDS_READ,250) , > >>the output record number is from 250 to 820. If run with > >>e.read(EventLog::SEEK_READ|EventLog::FORWARDS_READ,42) , the output > >>record number is from 42 to 570. Why this happens? Is it the bug of > >>MS? > > >I can confirm this behavior. It looks like a problem with > the buffer > >size > >and reallocation. Because, if I increase the BUFFER_SIZE > macro, I get more > >records. > > >Now, as to why the realloc() isn't working like we expect > I'm not sure. > OK, I understand what happens. > > Now I fixed it and committed to CVS. > > Thanks, > > Park Heesob > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > > From win32utils-devel at rubyforge.org Wed Nov 3 11:03:17 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 3 11:03:29 2004 Subject: [Win32utils-devel] rdoc, ri and gems Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B075@itomae2km07.AD.QINTRA.COM> Hi all, I've been going over the chapters on RDOC and gems lately. I think we should probably work on making the code in Win32Utils "rdoc" friendly. I've started doing this with 'win32-ipc' as an experiment. This probably means some directory reorganization, because I think gems looks for extensions in an 'ext' directory, whereas we have everything under 'lib' for now. I'll change that if I have to. I may also move the 'examples' subdirectory to the toplevel. I'm in no big hurry to do this, however. I'm not finding rdoc to be very flexible or friendly and some things don't work the way I think they ought to. Also, I know this probably means delaying another release of the installer. However, I like the ri documentation, so if that means switching to rdoc over rd, so be it. I plan on keeping the .txt and .rd files around, though. I'll use win32-ipc as an experiment and see how it goes. Dan From win32utils-devel at rubyforge.org Wed Nov 3 13:39:40 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 3 13:39:55 2004 Subject: [Win32utils-devel] rdoc, ri and gems In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B075@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B075@itomae2km07.AD.QINTRA.COM> Message-ID: <418925EC.4030503@everestkc.net> Hi, win32utils-devel@rubyforge.org wrote: >Hi all, > >I've been going over the chapters on RDOC and gems lately. I think we >should probably work on making the code in Win32Utils "rdoc" friendly. >I've started doing this with 'win32-ipc' as an experiment. > > This is a very good idea ! >This probably means some directory reorganization, because I think gems >looks for extensions in an 'ext' directory, whereas we have everything >under 'lib' for now. I'll change that if I have to. I may also move >the 'examples' subdirectory to the toplevel. > > During the Conference, Chad and Jim had very patiently explained to me the process of creating gems (thanks a lot, Chad, Jim) and Jim has shown me how I could use rake to automate the build. I was planning to put it all together before our next release but the thought languished. But I remember Chad mentioning to me that if we have a one-click installer then we do not need the gems (and vice-versa). Not that it matters though, since we can (and should) always offer both options :-) The one-click installer has a slight advantage in that we can put our sample/test files in any folder of our choice which is not (yet) possible using gems. Or is it? Dan, I will like to build on the code (gemspec/rakefile) I had written at the conference if it is OK by you. Let me know... >I'm in no big hurry to do this, however. I'm not finding rdoc to be >very flexible or friendly and some things don't work the way I think >they ought to. Also, I know this probably means delaying another >release of the installer. However, I like the ri documentation, so if >that means switching to rdoc over rd, so be it. I plan on keeping the >.txt and .rd files around, though. > > Yes, no hurry (especially when I have not much time for a couple of weeks ;-)). >I'll use win32-ipc as an experiment and see how it goes. > > Cool ! Keep up the good work. >Dan > > -- Shashank From win32utils-devel at rubyforge.org Wed Nov 3 15:10:25 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 3 15:08:25 2004 Subject: [Win32utils-devel] rdoc, ri and gems In-Reply-To: <418925EC.4030503@everestkc.net> References: <8FE83020B9E1A248A182A9B0A7B76E7358B075@itomae2km07.AD.QINTRA.COM> <418925EC.4030503@everestkc.net> Message-ID: <27757.68.208.204.7.1099512625.squirrel@68.208.204.7> (Sorry if you've gotten more than one copy of this...mail client issues) Hi. Not sure if this will make it to the list, but let's see. Comments below. > Hi, > > win32utils-devel@rubyforge.org wrote: > >>Hi all, >> >>I've been going over the chapters on RDOC and gems lately. I think we >>should probably work on making the code in Win32Utils "rdoc" friendly. >>I've started doing this with 'win32-ipc' as an experiment. >> >> > This is a very good idea ! > >>This probably means some directory reorganization, because I think gems >>looks for extensions in an 'ext' directory, whereas we have everything >>under 'lib' for now. I'll change that if I have to. I may also move >>the 'examples' subdirectory to the toplevel. >> >> Actually rubygems doesn't _require_ that you use the lib and ext directories this way. But it's generally thought to be good packaging etiquette to do so. You can put an extconf.rb anywhere you like and just specify it in the "extensions" attribute of the gemspec. Same goes for "requirepath". > During the Conference, Chad and Jim had very patiently explained to me > the process of creating gems (thanks a lot, Chad, Jim) and Jim has shown > me how I could use rake to automate the build. > > I was planning to put it all together before our next release but the > thought languished. But I remember Chad mentioning to me that if we have > a one-click installer then we do not need the gems (and vice-versa). > Not that it matters though, since we can (and should) always offer both > options :-) > The one-click installer has a slight advantage in that we can put our > sample/test files in any folder of our choice which is not (yet) > possible using gems. Or is it? > So, based on the above, the advantage you list here is moot. Generally, though, if Windows users have a standard Windows installer, the typical pain of installing libraries goes away, so the advantage of RubyGems is a little less marked. It may, however, be easier for someone to automate the installation of libraries if they're available as RubyGems. And it's really easy to upgrade. I think there's something to be said for having the same interface for installing as many libraries as once. For example, if you wanted to use both BlueCloth and the speech API bindings in the same program, it's nice to just do: gem install bluecloth gem install speech (or whatever it would be called. All in all, you guys are really creating some good stuff. Regardless of what the _best_ solution is, I would be thrilled to see this stuff installable as gems. One last thing I left out is that when Curt goes to Gems-based installation of libs for the one-click installer, having these as Gems will really help to get you integrated into that project, which would be great. Thanks, Chad From win32utils-devel at rubyforge.org Wed Nov 3 15:21:28 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 3 15:21:47 2004 Subject: [Win32utils-devel] rdoc, ri and gems Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B076@itomae2km07.AD.QINTRA.COM> Hi all, > > But I remember Chad mentioning to me that if we > > have a one-click installer then we do not need the gems (and > > vice-versa). Not that it matters though, since we can (and should) > > always offer both options :-) The one-click installer has a slight > > advantage in that we can put our sample/test files in any folder of > > our choice which is not (yet) possible using gems. Or is it? > > > > So, based on the above, the advantage you list here is moot. > Generally, though, if Windows users have a standard Windows > installer, the typical pain of installing libraries goes > away, so the advantage of RubyGems is a little less marked. > It may, however, be easier for someone to automate the > installation of libraries if they're available as RubyGems. > And it's really easy to upgrade. My real motivation for wanting both gems and an installer is that the individual packages tend to get ahead of our installer. Considering the number of packages we have, I think it's a bit unrealistic to put out a new installer every time I decide to scratch an itch and put out a new release for a given package (which I tend to do often). Having a gem immediately available for individual packages would be nice for folks who can't/don't have a compiler and don't want to wait for the next release of the installer. But, I still want the installer, too. > One last thing I left out is that when Curt goes to Gems-based > installation of libs for the one-click installer, having > these as Gems will really help to get you integrated into that project, which would be great. The possible integration with Curt's installer is a bonus. :) > I think there's something > to be said for having the same interface for installing as > many libraries as once. Yep, there's that, too. :) Dan From win32utils-devel at rubyforge.org Wed Nov 3 19:37:41 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 3 19:38:04 2004 Subject: [Win32utils-devel] rdoc, ri and gems In-Reply-To: <27757.68.208.204.7.1099512625.squirrel@68.208.204.7> References: <8FE83020B9E1A248A182A9B0A7B76E7358B075@itomae2km07.AD.QINTRA.COM> <418925EC.4030503@everestkc.net> <27757.68.208.204.7.1099512625.squirrel@68.208.204.7> Message-ID: <418979D5.5060501@everestkc.net> Hi, win32utils-devel@rubyforge.org wrote: >So, based on the above, the advantage you list here is moot. > Oh, great ! So we will be able to put the samples in the c:\ruby\samples\win32utils folder then. That is really wonderfull! >It may, however, be easier for someone to automate >the installation of libraries if they're available as RubyGems. And it's >really easy to upgrade. I think there's something to be said for having >the same interface for installing as many libraries as once. > > Touch?. >All in all, you guys are really creating some good stuff. Regardless of >what the _best_ solution is, I would be thrilled to see this stuff >installable as gems. > > Thanks. It will be ... very soon. >One last thing I left out is that when Curt goes to Gems-based >installation of libs for the one-click installer, having these as Gems >will really help to get you integrated into that project, which would be >great. > > Splendid !! >Thanks, >Chad > > Thank you, -- Shashank From win32utils-devel at rubyforge.org Thu Nov 4 14:50:57 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 4 14:51:06 2004 Subject: [Win32utils-devel] Attempt to build a gemspec Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B079@itomae2km07.AD.QINTRA.COM> Hi all, I'm trying to build a gemspec for win32-ipc, using a precompiled binary. Here's my gemspec file: #win32-ipc.gemspec require "rubygems" spec = Gem::Specification.new do |s| s.name = "win32-ipc" s.version = "0.3.1" s.platform = Gem::Platform::WIN32 s.summary = "A base class for Win32 synchronization objects." s.files = ["ipc.so"] s.require_path = "." s.autorequire = "win32/ipc" s.has_rdoc = true s.extra_rdoc_files = ["README","CHANGES"] opts = '-S --title A base class for Win32 synchronization objects.' opts << ' --main README' s.rdoc_options = opts s.test_files = Dir.glob("test/tc_*.rb") s.author = "Daniel J. Berger" s.email = "djberg96@yahoo.com" s.homepage = "http://www.rubyforge.org/projects/win32utils" end if $0 == __FILE__ Gem.manage_gems Gem::Builder.new(spec).build end It seems to build fine. When I run 'gem install' however, I get this: C:\eclipse\workspace\win32-ipc>gem install win32-ipc-0.3.1-mswin32.gem Attempting local installation of 'win32-ipc-0.3.1-mswin32.gem' Successfully installed win32-ipc, version 0.3.1 Installing RDoc documentation for win32-ipc-0.3.1-mswin32... ERROR: While executing gem ... (TypeError) cannot convert Array into String It does seem to install under the ruby/gems directory, though. But, if I try to do "require 'win32/ipc'", it says it can't find it. What am I doing wrong? Regards, Dan From win32utils-devel at rubyforge.org Thu Nov 4 19:36:52 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 4 19:37:02 2004 Subject: [Win32utils-devel] Attempt to build a gemspec In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B079@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B079@itomae2km07.AD.QINTRA.COM> Message-ID: <418ACB24.3050006@everestkc.net> Hi Dan, Try this: > s.require_path = "." > > s.require_path = "lib" >But, if I try to do "require 'win32/ipc'", it says it can't find it. > > > require 'rubygems' require_gem 'win32-ipc' >What am I doing wrong? >Regards, > > HTH, >Dan > > -- shanko From win32utils-devel at rubyforge.org Thu Nov 4 20:00:47 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 4 20:00:57 2004 Subject: [Win32utils-devel] Attempt to build a gemspec In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B079@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B079@itomae2km07.AD.QINTRA.COM> Message-ID: <418AD0BF.5020002@everestkc.net> Forgot one more thing: win32utils-devel@rubyforge.org wrote: > s.rdoc_options = opts > > s.rdoc_options = [opts] > s.test_files = Dir.glob("test/tc_*.rb") > > s.author = "Daniel J. Berger" > s.email = "djberg96@yahoo.com" > s.homepage = "http://www.rubyforge.org/projects/win32utils" > >end > >if $0 == __FILE__ > Gem.manage_gems > Gem::Builder.new(spec).build >end > >It seems to build fine. When I run 'gem install' however, I get this: > >C:\eclipse\workspace\win32-ipc>gem install win32-ipc-0.3.1-mswin32.gem >Attempting local installation of 'win32-ipc-0.3.1-mswin32.gem' >Successfully installed win32-ipc, version 0.3.1 >Installing RDoc documentation for win32-ipc-0.3.1-mswin32... >ERROR: While executing gem ... (TypeError) > cannot convert Array into String > >It does seem to install under the ruby/gems directory, though. > >But, if I try to do "require 'win32/ipc'", it says it can't find it. > >What am I doing wrong? > >Regards, > >Dan > >_______________________________________________ >win32utils-devel mailing list >win32utils-devel@rubyforge.org >http://rubyforge.org/mailman/listinfo/win32utils-devel > > > From win32utils-devel at rubyforge.org Fri Nov 5 10:01:11 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Fri Nov 5 10:01:16 2004 Subject: [Win32utils-devel] Attempt to build a gemspec Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B07A@itomae2km07.AD.QINTRA.COM> Ok, we're getting further. > >But, if I try to do "require 'win32/ipc'", it says it can't find it. > > > > > > > require 'rubygems' > require_gem 'win32-ipc' First, I thought you didn't have to do this with gems unless you wanted a specific version. Second, I'm still doing something wrong. When I tried that I got: irb(main):003:0> require_gem "win32-ipc" LoadError: No such file to load -- win32/ipc from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `r equire__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `r equire' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:148:in `activate' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:34:in `require_gem' from (irb):3 Below is the current gemspec (slightly simplified since my last post) require "rubygems" spec = Gem::Specification.new do |s| s.name = "win32-ipc" s.version = "0.3.1" s.platform = Gem::Platform::WIN32 s.summary = "A base class for Win32 synchronization objects." s.files = ["ipc.so","lib/win32/ipc.c","lib/win32/ipc.h"] s.require_path = "lib" s.autorequire = "win32/ipc" s.has_rdoc = true s.extra_rdoc_files = ["README","CHANGES"] s.rdoc_options = ["-S"] s.test_file = "test/tc_ipc.rb" s.author = "Daniel J. Berger" s.email = "djberg96@yahoo.com" s.homepage = "http://www.rubyforge.org/projects/win32utils" end if $0 == __FILE__ Gem.manage_gems Gem::Builder.new(spec).build end From win32utils-devel at rubyforge.org Fri Nov 5 12:55:29 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Fri Nov 5 12:55:42 2004 Subject: [Win32utils-devel] Attempt to build a gemspec In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B07A@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B07A@itomae2km07.AD.QINTRA.COM> Message-ID: <418BBE91.6010906@everestkc.net> Dan, It works for me ...see transcript below: win32utils-devel@rubyforge.org wrote: >a specific version. Second, I'm still doing something wrong. When I >tried that I got: > >irb(main):003:0> require_gem "win32-ipc" >LoadError: No such file to load -- win32/ipc > from > > #------------------------------------------ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\dan\win32utils\win32utils\win32-ipc>type ipc2.gemspec require "rubygems" spec = Gem::Specification.new do |s| s.name = "win32-ipc" s.version = "0.3.1" s.platform = Gem::Platform::WIN32 s.summary = "A base class for Win32 synchronization objects." s.files = ["ipc.so","lib/win32/ipc.c","lib/win32/ipc.h"] s.require_path = "lib" s.autorequire = "win32/ipc" s.has_rdoc = true s.extra_rdoc_files = ["README","CHANGES"] s.rdoc_options = ["-S"] s.test_file = "test/tc_ipc.rb" s.author = "Daniel J. Berger" s.email = "djberg96@yahoo.com" s.homepage = "http://www.rubyforge.org/projects/win32utils" end if $0 == __FILE__ Gem.manage_gems Gem::Builder.new(spec).build end C:\dan\win32utils\win32utils\win32-ipc>ruby ipc2.gemspec Successfully built RubyGem Name: win32-ipc Version: 0.3.1 File: win32-ipc-0.3.1-mswin32.gem C:\dan\win32utils\win32utils\win32-ipc>gem install win32-ipc-0.3.1-mswin32.gem Attempting local installation of 'win32-ipc-0.3.1-mswin32.gem' Successfully installed win32-ipc, version 0.3.1 Installing RDoc documentation for win32-ipc-0.3.1-mswin32... No definition for ipc_wait_any No definition for ipc_wait_all No definition for ipc_init No definition for ipc_wait C:\dan\win32utils\win32utils\win32-ipc> ------------------------------------------------------------------------ From win32utils-devel at rubyforge.org Sat Nov 6 06:30:07 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 6 06:31:03 2004 Subject: [Win32utils-devel] Calling CreateFile on an instance of File - possible? Message-ID: Hi all, I'm going over win32-file this weekend. I'm creating instance methods for setting (or unsetting) the various file attributes. So, you can do something like: f = File.open("foo.txt") f.archive = true f.hidden = true f.close This works for the basic attributes, but it requires extra work for others. Specifically, I am having trouble trying to set the 'compress' attribute. To do this requires calling CreateFile() + DeviceIoControl(). The thing is, I don't know how to get a valid HANDLE to a instance of an already opened file. I've been trying something like this: static VALUE file_set_compressed(VALUE self, VALUE rbBool){ DWORD dwAttr; VALUE rbPath; HANDLE h; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } rbPath = rb_funcall(self,rb_intern("path"),0,0); dwAttr = GetFileAttributes(StringValuePtr(rbPath)); h = CreateFile( (LPCTSTR)StringValuePtr(rbPath), FILE_ALL_ACCESS, FILE_SHARE_READ, NULL, OPEN_EXISTING, dwAttr, NULL ); if(h == INVALID_HANDLE_VALUE){ printf("Error opening file: %s\n",ErrorDescription(GetLastError())); return Qnil; } ... } I've tried various flags for the different arguments, all to no avail. I either get "permission denied" or "Error opening file: The process cannot access the file because it is being used by another process.", depending on the flag I use. So, is it even possible to call CreateFile() to get a HANDLE? Or is there some way I could use the existing file descriptor? I tried using fileno, but had no luck. Or, am I simply going to have to force this to be a class method? Regards, Dan From win32utils-devel at rubyforge.org Sat Nov 6 20:44:08 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 6 20:44:41 2004 Subject: [Win32utils-devel] Calling CreateFile on an instance of File - possible? In-Reply-To: References: Message-ID: <1724721972.20041106174408@netgate.net> Hi Dan, First, thanks for all your great work on the win32-* libraries! > I don't know how to get a valid HANDLE to a instance of an > already opened file. I took a look at how to determine the HANDLE that corresponds to a given FILE* or a fileno. Not surprisingly, I couldn't find any way to recover that HANDLE. Since this file must have a HANDLE, another approach would be to look at all the HANDLEs in the process and find the one that corresponds to this file. This is possible, because Process Explorer from www.sysinternals.com will display (among many other things) all the File HANDLES in a process, and the full path to their files. Unfortunately, sysinternals no longer releases the source for Process Explorer, and I don't know how they get this information. Take care, Wayne Vucenic Saturday, November 6, 2004, 3:30:07 AM, you wrote: > Hi all, > I'm going over win32-file this weekend. I'm creating instance methods for > setting (or unsetting) the various file attributes. So, you can do > something like: > f = File.open("foo.txt") > f.archive = true > f.hidden = true > f.close > This works for the basic attributes, but it requires extra work for others. > Specifically, I am having trouble trying to set the 'compress' attribute. > To do this requires calling CreateFile() + DeviceIoControl(). > The thing is, I don't know how to get a valid HANDLE to a instance of an > already opened file. I've been trying something like this: > static VALUE file_set_compressed(VALUE self, VALUE rbBool){ > DWORD dwAttr; > VALUE rbPath; > HANDLE h; > if((rbBool != Qtrue) && (rbBool != Qfalse)){ > rb_raise(rb_eTypeError,"Argument must be true or false"); > } > rbPath = rb_funcall(self,rb_intern("path"),0,0); > dwAttr = GetFileAttributes(StringValuePtr(rbPath)); > h = CreateFile( > (LPCTSTR)StringValuePtr(rbPath), > FILE_ALL_ACCESS, > FILE_SHARE_READ, > NULL, > OPEN_EXISTING, > dwAttr, > NULL > ); > if(h == INVALID_HANDLE_VALUE){ > printf("Error opening file: > %s\n",ErrorDescription(GetLastError())); > return Qnil; > } > ... > } > I've tried various flags for the different arguments, all to no avail. I > either get "permission denied" or "Error opening file: The process cannot > access the file because it is being used > by another process.", depending on the flag I use. > So, is it even possible to call CreateFile() to get a HANDLE? Or is there > some way I could use the existing file descriptor? I tried using fileno, > but had no luck. > Or, am I simply going to have to force this to be a class method? > Regards, > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel From win32utils-devel at rubyforge.org Sat Nov 6 21:10:56 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 6 21:10:49 2004 Subject: [Win32utils-devel] Calling CreateFile on an instance of File -possible? References: <1724721972.20041106174408@netgate.net> Message-ID: <000401c4c46f$04a2ab40$bcdefea9@2xnm9896kmqn5b9> Hi, > Hi Dan, > > First, thanks for all your great work on the win32-* libraries! > >> I don't know how to get a valid HANDLE to a instance of an >> already opened file. > > I took a look at how to determine the HANDLE that corresponds to a > given FILE* or a fileno. Not surprisingly, I couldn't find any way to > recover that HANDLE. > > You can use _get_osfhandle function to get the HANDLE from a fileno. Refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__get_osfhandle.asp > Take care, > > Wayne Vucenic > Regards, Park Heesob From win32utils-devel at rubyforge.org Sat Nov 6 21:41:26 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 6 21:42:06 2004 Subject: [Win32utils-devel] Calling CreateFile on an instance of File -possible? In-Reply-To: <000401c4c46f$04a2ab40$bcdefea9@2xnm9896kmqn5b9> References: <1724721972.20041106174408@netgate.net> <000401c4c46f$04a2ab40$bcdefea9@2xnm9896kmqn5b9> Message-ID: <1949896046.20041106184126@netgate.net> Hi Park, > You can use _get_osfhandle function to get the HANDLE from a fileno. > Refer to > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__get_osfhandle.asp That's a great piece of information! Since the _fileno function will get the fileno from a FILE*: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__fileno.asp we can now convert FILE* ==> fileno ==> HANDLE I think this might do what Dan needs. Take care, Wayne Vucenic From win32utils-devel at rubyforge.org Sun Nov 7 11:09:50 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sun Nov 7 11:09:52 2004 Subject: [Win32utils-devel] Problems with DeviceIoControl() Message-ID: <20041107160950.71848.qmail@web50308.mail.yahoo.com> Hi all, Thanks to Wayne and Park, I've got something like this now: static VALUE file_set_compressed(VALUE self, VALUE rbBool){ HANDLE h; BOOL rv; DWORD dwBytesReturned; int fn; USHORT inBuf = COMPRESSION_FORMAT_DEFAULT; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } if(rbBool == Qfalse){ inBuf = COMPRESSION_FORMAT_NONE; } fn = NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0)); h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based on fileno if(h == INVALID_HANDLE_VALUE){ rb_raise(cFileError,ErrorDescription(GetLastError())); } rv = DeviceIoControl( h, FSCTL_SET_COMPRESSION, (LPVOID)inBuf, sizeof(inBuf), NULL, 0, &dwBytesReturned, NULL ); if(!rv){ rb_raise(cFileError,ErrorDescription(GetLastError())); } return self; } // Inside Init_file() rb_define_method(rb_cFile,"compressed=",file_set_compressed,1); # Sample program f = File.open("temp.txt") f.compressed = true f.close But, I'm still getting "access denied" or "invalid access to memory location", depending on the open mode flag I use. Testing indicates that I am getting a valid HANDLE, but that DeviceIoControl() is failing. I can, however, compress the file using the GUI interface. Any ideas? Wayne, I saw your note on using _fileno, but I don't think I need it here, do I? Regards, Dan __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com From win32utils-devel at rubyforge.org Mon Nov 8 01:25:29 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 8 01:26:26 2004 Subject: [Win32utils-devel] Problems with DeviceIoControl() In-Reply-To: <20041107160950.71848.qmail@web50308.mail.yahoo.com> References: <20041107160950.71848.qmail@web50308.mail.yahoo.com> Message-ID: <1226443163.20041107222529@netgate.net> Hi Dan, > Wayne, I saw your note on using _fileno, but I don't > think I need it here, do I? No, it doesn't look like you need to use _fileno. Yesterday I took a quick look at Ruby's file.c code, and it looked to me that it was using a FILE* instead of a fileno, so I thought it might be necessary to first use _fileno to get a fileno to be able to use the function Park pointed out. But based on your code it looks like you directly have access to fileno, so _fileno isn't needed. I'll try to run some experiments with DeviceIoControl(), and if I learn anything useful, I'll let you know. Take care, Wayne Vucenic From win32utils-devel at rubyforge.org Mon Nov 8 03:00:01 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 8 03:00:02 2004 Subject: [Win32utils-devel] Problems with DeviceIoControl() Message-ID: <200411080800.iA88014U020979@localhost> Hi, > > Hi all, > > Thanks to Wayne and Park, I've got something like this > now: > .. > > But, I'm still getting "access denied" or "invalid > access to memory location", depending on the open mode > flag I use. > > Testing indicates that I am getting a valid HANDLE, > but that DeviceIoControl() is failing. I can, > however, compress the file using the GUI interface. > > Any ideas? > > Wayne, I saw your note on using _fileno, but I don't > think I need it here, do I? > You have missed & before inBuf. Here is my modified version: --------------------------------------------------------------- static VALUE file_set_compressed(VALUE self, VALUE rbBool){ HANDLE h; BOOL rv; DWORD dwBytesReturned; int fn; VALUE rbPath; USHORT inBuf = COMPRESSION_FORMAT_DEFAULT; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } if(rbBool == Qfalse){ inBuf = COMPRESSION_FORMAT_NONE; } rbPath = rb_funcall(self,rb_intern("path"),0,0); h = CreateFile( StringValuePtr(rbPath), FILE_READ_DATA | FILE_WRITE_DATA, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); rv = DeviceIoControl( h, FSCTL_SET_COMPRESSION, (LPVOID)&inBuf, sizeof(inBuf), NULL, 0, &dwBytesReturned, NULL ); CloseHandle( h ); if(!rv){ rb_raise(cFileError,ErrorDescription(GetLastError())); } return self; } ---------------------------------------------------------------- Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Mon Nov 8 20:41:11 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 8 20:42:11 2004 Subject: [Win32utils-devel] Re: Problems with DeviceIoControl Message-ID: Hi all, >You have missed & before inBuf. D'oh! Odd that I didn't get a warning. >Here is my modified version: It worked, but it seems to eliminate the file's contents in the process. I've tried various flags with no luck. Any ideas? Regards, Dan From win32utils-devel at rubyforge.org Mon Nov 8 21:19:04 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 8 21:19:04 2004 Subject: [Win32utils-devel] Re: Problems with DeviceIoControl Message-ID: <200411090219.iA92J4lI020882@localhost> Hi, >It worked, but it seems to eliminate the file's contents in the process. >I've tried various flags with no luck. What do you mean by that? Here is my sample code and it worked fine. require 'win32/file' f = File.open("c:/test","a") f.puts "test" f.compressed = true f.close Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Tue Nov 9 00:12:14 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 9 00:12:58 2004 Subject: [Win32utils-devel] Re: Problems with DeviceIoControl Message-ID: >What do you mean by that? >Here is my sample code and it worked fine. Whoops, never mind. User error. ;) Thanks much. Dan From win32utils-devel at rubyforge.org Tue Nov 9 20:53:27 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 9 20:54:07 2004 Subject: [Win32utils-devel] Silly question of the day: "permission" vs "permissions" Message-ID: Hi all, I noticed that I named the permission methods "get_permission" and "set_permission". For some reason this is bugging me. Would anyone object if I changed it to "get_permissions" and "set_permissions"? I don't really want to create an alias... Regards, Dan From win32utils-devel at rubyforge.org Wed Nov 10 03:28:58 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 10 03:29:02 2004 Subject: [Win32utils-devel] Silly question of the day: Message-ID: <200411100828.iAA8Sw7k027485@localhost> Hi, > > Hi all, > > I noticed that I named the permission methods "get_permission" and > "set_permission". For some reason this is bugging me. Would anyone object > if I changed it to "get_permissions" and "set_permissions"? I don't really > want to create an alias... > Following is the Result of the Google Search get_permissions : 1190 get_permission : 439 set_permission : 260 set_permissions : 222 So I recommend get_permissions and set_permission. :-) Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Wed Nov 10 11:04:07 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 10 11:04:03 2004 Subject: [Win32utils-devel] Silly question of the day: Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B085@itomae2km07.AD.QINTRA.COM> Haha. :) Well, I'm going to alter both, I'm afraid. I should have a release out very soon. Dan > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Wednesday, November 10, 2004 1:29 AM > To: win32utils-devel@rubyforge.org > Subject: Re:[Win32utils-devel] Silly question of the day: > > > Hi, > > > > Hi all, > > > > I noticed that I named the permission methods "get_permission" and > > "set_permission". For some reason this is bugging me. > Would anyone object > > if I changed it to "get_permissions" and "set_permissions"? > I don't really > > want to create an alias... > > > Following is the Result of the Google Search > > get_permissions : 1190 > get_permission : 439 > set_permission : 260 > set_permissions : 222 > > So I recommend get_permissions and set_permission. :-) > > Regards, > > Park Heesob > > > > --MIME Multi-part separator-- > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > > From win32utils-devel at rubyforge.org Thu Nov 11 01:17:51 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 01:17:54 2004 Subject: [Win32utils-devel] File.open on a directory? Message-ID: Hi all, Windows 2000 Ruby 1.8.2 RC9 Is it possible to call File.open on a directory in Windows? I always get Errno::EACCES, even though there are no special settings on the directories I've tried and I have full access. Dan From win32utils-devel at rubyforge.org Thu Nov 11 02:49:52 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 02:49:46 2004 Subject: [Win32utils-devel] File.open on a directory? Message-ID: <200411110749.iAB7nqpk012296@localhost> Hi, > > Hi all, > > Windows 2000 > Ruby 1.8.2 RC9 > > Is it possible to call File.open on a directory in Windows? I always get > Errno::EACCES, even though there are no special settings on the directories > I've tried and I have full access. > > Dan > The open function cannot open directory on Windows. it returns EACCES if given path is directory. You should use CreateFile function to open directory. Opening a directory with CreateFile requires the FILE_FLAG_BACKUP_SEMANTICS flag. Refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__open.2c_._wopen.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Thu Nov 11 10:45:55 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 10:45:46 2004 Subject: [Win32utils-devel] File.open on a directory? Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B08B@itomae2km07.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Thursday, November 11, 2004 12:50 AM > To: win32utils-devel@rubyforge.org > Subject: Re:[Win32utils-devel] File.open on a directory? > > > The open function cannot open directory on Windows. it > returns EACCES if given path is directory. > > You should use CreateFile function to open directory. > Opening a directory with CreateFile requires the > FILE_FLAG_BACKUP_SEMANTICS flag. Time for the 'dopen' class method. :) Dan From win32utils-devel at rubyforge.org Thu Nov 11 13:04:30 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 13:04:28 2004 Subject: [Win32utils-devel] File.nopen alpha Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B08E@itomae2km07.AD.QINTRA.COM> Hi all, I've committed an alpha version of File.nopen (native open) to win32-file. This is a wrapper for CreateFile(). A quick synopsis: * File.nopen(file,access_mode,share_mode,creation_mode,flags) * * A 'native' open method. This uses CreateFile() behind the scenes instead of * the _open() function. This allows much greater flexibility when it comes * to Windows files. It also allows you to open directories, which File.open * cannot do on Windows. * * The access mode defaults to READ_DATA | WRITE_DATA * The share mode defaults to SHARE_READ | SHARE_WRITE * The creation mode defaults to OPEN_EXISTING * The flags default to NORMAL * * To open a directory, pass File::BACKUP_SEMANTICS as the 'flags' argument. So, with this I can do: dir = "C:\\TEST" # directory fh = File.nopen(dir,nil,nil,nil,File::BACKUP_SEMANTICS) p fh # Yup, it's a File object p fh.class # File fh.close I can also open a plain file and read the contents. So far, so good. But, when I try to write to the file, I get an IOError claiming the file isn't opened for writing. Shouldn't the WRITE_DATA flag have given me permission to write? I tried combinations of some other flags with no luck. Also, I noticed that if I try to use some of the new instance methods like this: fh = File.nopen("C:\\temp.txt",File::WRITE_ATTRIBUTES) fh.hidden = true fh.close I get "test.rb:16:in `hidden=': cannot convert nil into String (TypeError)" Any ideas on these? Please take a look and also let me know what you think in general of an nopen() method. Regards, Dan From win32utils-devel at rubyforge.org Thu Nov 11 13:51:04 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 13:51:01 2004 Subject: [Win32utils-devel] File.nopen alpha Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B090@itomae2km07.AD.QINTRA.COM> Just a quick followup: > I can also open a plain file and read the contents. So far, > so good. But, when I try to write to the file, I get an > IOError claiming the file isn't opened for writing. > Shouldn't the WRITE_DATA flag have given me permission to > write? I tried combinations of some other flags with no luck. For a second I thought it was this line causing the problems: fd = _open_osfhandle((long)h,O_RDONLY); But, changing that to O_RDWR had no effect. Dan From win32utils-devel at rubyforge.org Thu Nov 11 14:22:26 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 14:22:23 2004 Subject: [Win32utils-devel] File.nopen alpha - another followup Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B091@itomae2km07.AD.QINTRA.COM> Hi all, > fh = File.nopen("C:\\temp.txt",File::WRITE_ATTRIBUTES) > fh.hidden = true > fh.close > > I get "test.rb:16:in `hidden=': cannot convert nil into > String (TypeError)" It looks like this line is the culprit: rbPath = rb_funcall(self,rb_intern("path"),0,0); Hm...we could use GetFullPathName() if rbPath is nil. That, however, doesn't deal with the fact that there are probably several other internal attributes that aren't set if you use nopen(). I suppose I need to take a look at the open/new implementation in file.c and see what else it does, and try to imitate it the best I can. Dan From win32utils-devel at rubyforge.org Thu Nov 11 20:38:50 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 11 20:38:52 2004 Subject: [Win32utils-devel] File.nopen alpha Message-ID: <200411120138.iAC1coms026018@localhost> Hi, > > Hi all, > > I've committed an alpha version of File.nopen (native open) to > win32-file. This is a wrapper for CreateFile(). A quick synopsis: > > * File.nopen(file,access_mode,share_mode,creation_mode,flags) > * > * A 'native' open method. This uses CreateFile() behind the scenes > instead of > * the _open() function. This allows much greater flexibility when it > comes > * to Windows files. It also allows you to open directories, which > File.open > * cannot do on Windows. > * > * The access mode defaults to READ_DATA | WRITE_DATA > * The share mode defaults to SHARE_READ | SHARE_WRITE > * The creation mode defaults to OPEN_EXISTING > * The flags default to NORMAL > * > * To open a directory, pass File::BACKUP_SEMANTICS as the 'flags' > argument. > > So, with this I can do: > > dir = "C:\\TEST" # directory > fh = File.nopen(dir,nil,nil,nil,File::BACKUP_SEMANTICS) > p fh # Yup, it's a File object > p fh.class # File > fh.close > > I can also open a plain file and read the contents. So far, so good. > But, when I try to write to the file, I get an IOError claiming the file > isn't opened for writing. Shouldn't the WRITE_DATA flag have given me > permission to write? I tried combinations of some other flags with no > luck. > > Also, I noticed that if I try to use some of the new instance methods > like this: > > fh = File.nopen("C:\\temp.txt",File::WRITE_ATTRIBUTES) > fh.hidden = true > fh.close > > I get "test.rb:16:in `hidden=': cannot convert nil into String > (TypeError)" > > Any ideas on these? > > Please take a look and also let me know what you think in general of an > nopen() method. > WARNING: You are gone too far into the ruby core :-) I think the Ruby developer should implement the win32 open function compatible with unix. We might take over nopen function to win32 expert ruby developer like NAKAMURA Usaku or Nobuyoshi Nakada . Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Fri Nov 12 10:41:35 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Fri Nov 12 10:41:25 2004 Subject: [Win32utils-devel] File.nopen alpha Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B092@itomae2km07.AD.QINTRA.COM> > > > WARNING: You are gone too far into the ruby core :-) > > I think the Ruby developer should implement the win32 open > function compatible with unix. We might take over nopen > function to win32 expert ruby developer like NAKAMURA Usaku > or Nobuyoshi Nakada . > > Regards, > > Park Heesob How would you make a native win32 open function Unix compatible? I don't follow. Of course, I certainly wouldn't mind if Nobu were to join Win32Utils. :) In other news, I've eliminated the path issue by aliasing File#path, and then redefining it. If the original File#path fails, it resorts to GetFullPathName(). Seems to work just fine. As for the write issue, it looks like it's being caused by the rb_io_check_writable() function in io.c. I'll dig deeper into this. - Dan From win32utils-devel at rubyforge.org Fri Nov 12 12:12:44 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Fri Nov 12 12:12:34 2004 Subject: [Win32utils-devel] FW: File.link on Win32 Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B094@itomae2km07.AD.QINTRA.COM> I sent this to ruby-core. I meant to cc win32utils as well. :) Dan -----Original Message----- From: Berger, Daniel [mailto:Daniel.Berger@qwest.com] Sent: Friday, November 12, 2004 10:08 AM To: ruby-core@ruby-lang.org Subject: File.link on Win32 Hi all, I noticed that win32.c in 1.8.2 p3 contained a link() function (or maybe it was always there and I never noticed). Anyway, it doesn't seem to work properly. File.link("C:\\temp.txt","C:\\temp.lnk") It creates a shortcut, but it's busted. Double clicking on the shortcut does nothing. If I right click on the shortcut in Windows Explorer and select the "shortcut" tab it says, "This is not a valid shortcut". Any ideas? Regards, Dan From win32utils-devel at rubyforge.org Sat Nov 13 07:12:16 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 13 07:12:52 2004 Subject: [Win32utils-devel] Sanity check for win32-file Message-ID: Hi all, The code that I checked in yesterday that seemed to work just fine now fails. When I run this: require "win32/file" fh = File.nopen("C:\\test.txt") fh.close I now get: test.rb:12:in `initialize': Invalid argument (Errno::EINVAL) from test.rb:12:in `nopen' Specifically, it's failing on this in file.c: args[0] = UINT2NUM(_open_osfhandle((long)h,O_RDWR)); self = rb_class_new_instance(1,args,rb_cFile); // BOOM How could this work yesterday, and suddenly stop working today? What am I missing? Dan From win32utils-devel at rubyforge.org Sun Nov 14 22:56:17 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sun Nov 14 22:56:47 2004 Subject: [Win32utils-devel] Sanity re-checked Message-ID: Hi all, Windows 2000 VC++ 6 Well, it turns out I'm not insane. The rb_class_new_instance() chokes with RC9. However, when I rolled back to RC7, it worked fine. So, either something is broken in RC9 or this is some sort of VC6 vs VC7 issue. Can anyone else confirm? Regards, Dan From win32utils-devel at rubyforge.org Tue Nov 16 03:49:37 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 16 05:52:48 2004 Subject: [Win32utils-devel] Re: Win32, file descriptors and rb_io_check_writable() Message-ID: <200411160849.iAG8nbQI026854@localhost> Hi, > >Thank you very much Park. There is one curious difference I noticed >with the write operations. It seems that there is a line ending issue >between a file descriptor opened with File.open vs File.nopen. You >can see this easily enough by doing something like this: > >fh1 = File.open("test1.txt","w+") >fh1.print "hello\nworld\n" >fh1.close > >Open this up with notepad - looks fine. Now try this: > >fh2 = File.nopen("test2.txt",nil,nil,File::OPEN_ALWAYS) >fh2.print "hello\nworld\n" >fh2.close > >Opened with notepad, you'll see that the line endings aren't the same >(although wordpad handles them properly). I guess I should find an >octal dump tool for windows to verify. Hopefully, you'll see what I >mean. > Sorry if you receive this message again. My mail account seems to be messed. That is due to detault translation mode. Insert _setmode(NUM2INT(args[0]),_O_TEXT); after RFILE(self)->fptr->mode = rb_io_mode_flags("w+"); RFILE(self)->fptr->f = rb_fdopen(NUM2INT(args[0]),"w+"); in case of TEXT MODE. >Regards, > >Dan Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Tue Nov 16 10:22:39 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 16 10:22:20 2004 Subject: [Win32utils-devel] Re: Win32, file descriptors and rb_io_check_writable() Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B09F@itomae2km07.AD.QINTRA.COM> Hi Park, > That is due to detault translation mode. > > Insert > _setmode(NUM2INT(args[0]),_O_TEXT); > after > RFILE(self)->fptr->mode = rb_io_mode_flags("w+"); > RFILE(self)->fptr->f = rb_fdopen(NUM2INT(args[0]),"w+"); > in case of TEXT MODE. Ah, thanks. On a side note, any clue as to why Nobu's suggestion doesn't seem to work? I tried his suggested patch of sending a second argument. It compiles fine, and I don't get any warnings, but it simply doesn't seem to write anything to a file when I tried. See my note on the ML for more details. Dan From win32utils-devel at rubyforge.org Tue Nov 16 11:54:42 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 16 11:54:25 2004 Subject: [Win32utils-devel] win32-file: nread and nwrite Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0A0@itomae2km07.AD.QINTRA.COM> Hi all, I've got alpha versions of nread and nwrite now added to the win32-file class in CVS. They seem to work fine, although I've noticed one bug in the File#read method. Let's say we have a text file with "hello world" in it. If I call nread with no arguments, it works fine: fh = File.nopen("C:\\test.txt") p fh.nread -> "hello world" fh.close But, if I try to specify an argument, it seems to always want to return 9 to 11 bytes for some reason: fh = File.nopen("C:\\test.txt") p fh.nread(5) -> "hello\001u\002\003\000\002" fh.close How is it picking up these extra bytes? Let's modify test.txt to add the strings "this is a test" and "1 2 3" on their own lines. Now, if we modify our code again to read, say, 15 bytes, it works fine: fh = File.nopen("C:\\test.txt") p fh.nread(15) -> "hello world\r\nth" fh.close So, that works as expected. Why is it acting weird with strings under 12 bytes? Dan From win32utils-devel at rubyforge.org Tue Nov 16 19:06:27 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 16 19:06:10 2004 Subject: [Win32utils-devel] win32-file: nread and nwrite Message-ID: <200411170006.iAH06RAs020693@localhost> Hi, > Hi all, > > I've got alpha versions of nread and nwrite now added to the win32-file > class in CVS. They seem to work fine, although I've noticed one bug in > the File#read method. Let's say we have a text file with "hello world" > in it. If I call nread with no arguments, it works fine: > > fh = File.nopen("C:\\test.txt") > p fh.nread -> "hello world" > fh.close > > But, if I try to specify an argument, it seems to always want to return > 9 to 11 bytes for some reason: > > fh = File.nopen("C:\\test.txt") > p fh.nread(5) -> "hello\001u\002\003\000\002" > fh.close > > How is it picking up these extra bytes? > > Let's modify test.txt to add the strings "this is a test" and "1 2 3" on > their own lines. Now, if we modify our code again to read, say, 15 > bytes, it works fine: > > fh = File.nopen("C:\\test.txt") > p fh.nread(15) -> "hello world\r\nth" > fh.close > > So, that works as expected. Why is it acting weird with strings under > 12 bytes? > > Dan > That is due to a common pitfall of malloc :) Insert memset(lpBuffer,0x00,dwBytesToRead+1); after lpBuffer = (char*)malloc(dwBytesToRead+1); Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Tue Nov 16 19:23:23 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 16 19:23:07 2004 Subject: [Win32utils-devel] Re: Win32, file descriptors and rb Message-ID: <200411170023.iAH0NNwE025836@localhost> Hi Dan, > > Hi Park, > > On a side note, any clue as to why Nobu's suggestion doesn't seem to > work? I tried his suggested patch of sending a second argument. It > compiles fine, and I don't get any warnings, but it simply doesn't seem > to write anything to a file when I tried. > > See my note on the ML for more details. > Use this code instead of case: if(dwAccess & FILE_ALL_ACCESS) args[1] = INT2FIX(O_RDWR); else if(dwAccess & GENERIC_READ) args[1] = INT2FIX(O_RDONLY); else if(dwAccess & GENERIC_WRITE) args[1] = INT2FIX(O_WRONLY); else if(dwAccess) args[1] = INT2FIX(0); Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Wed Nov 17 10:34:06 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 17 10:33:50 2004 Subject: [Win32utils-devel] win32-file: nread and nwrite Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0A3@itomae2km07.AD.QINTRA.COM> > That is due to a common pitfall of malloc :) > > Insert > memset(lpBuffer,0x00,dwBytesToRead+1); > after > lpBuffer = (char*)malloc(dwBytesToRead+1); > > Regards, > > Park Heesob Thanks. Seems a strange thing to have to do. I understand what memset does, but I'm not entirely clear why I need it with malloc. I'll read up on it some more. Dan From win32utils-devel at rubyforge.org Wed Nov 17 10:50:19 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 17 10:50:09 2004 Subject: [Win32utils-devel] nread and nwrite optimizations Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0A4@itomae2km07.AD.QINTRA.COM> Hi all, So far, so good. Things seem to work just fine and, in the case of nread, I am getting incredible performance. I can't tell if this is due to some kind of caching, however. Anyway, there a couple of things I want to work out yet. The first is File#nread and Really Big Files. I created a 500 mb text file and sucked it into memory using Ruby's File#read method just fine. However, when I tried to use File#nread, it eventually died with a memory allocation error. Since I have 1GB of RAM (and wasn't using much), I'm not sure why it would complain. The second issue is getting FILE_FLAG_NO_BUFFERING to work. Mostly I just want to see if this will lead to a significant performance increase with reads and writes. But, using it has certain requirements that I don't totally understand. Any ideas for these two issues are definitely welcome. Dan From win32utils-devel at rubyforge.org Thu Nov 18 00:26:28 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 18 00:26:07 2004 Subject: [Win32utils-devel] nread and nwrite optimizations Message-ID: <200411180526.iAI5QSXg021609@localhost> Hi, > > Hi all, > > So far, so good. Things seem to work just fine and, in the case of > nread, I am getting incredible performance. I can't tell if this is due > to some kind of caching, however. > > Anyway, there a couple of things I want to work out yet. The first is > File#nread and Really Big Files. I created a 500 mb text file and > sucked it into memory using Ruby's File#read method just fine. However, > when I tried to use File#nread, it eventually died with a memory > allocation error. Since I have 1GB of RAM (and wasn't using much), I'm > not sure why it would complain. > For me, the memory allocation always return sucess. Even if 625 mb file > The second issue is getting FILE_FLAG_NO_BUFFERING to work. Mostly I > just want to see if this will lead to a significant performance increase > with reads and writes. But, using it has certain requirements that I > don't totally understand. > It seems that Reading the whole data with one ReadFile using FILE_FLAG_NO_BUFFERING is not working for large file. Refer to http://www.winimage.com/readfile.htm It contains source code and shows various ReadFile methods. > Any ideas for these two issues are definitely welcome. > Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Thu Nov 18 08:10:26 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 18 08:10:41 2004 Subject: [Win32utils-devel] FW: problem with win32 waitpid Message-ID: Forward from Laurent Julliiard. Any suggestions anyone? Dan >From: Laurent Julliard <Laurent.Julliard@xrce.xerox.com> >Reply-To: laurent@moldus.org >To: djberg96@hotmail.com >Subject: problem with win32 waitpid >Date: Thu, 18 Nov 2004 08:49:51 +0100 > >Dan, > >I am one of the developer of the FreeRIDE project (the Ruby IDE) and >I'm in charge of the FreeRIDE debugger with which we have had a >number of problems on Windows now mostly due to the "clunky" >implementation of IO/Process/Signal stuff on Win32. > >I recently came across your Win32 utils package and investigated the >use of win32 process as a replacement for the native Ruby >implementation. I currently have a problem which is the following: > >Somewhere in my code I have this: > >require 'win32/process' > >command = "start CMD /K ruby -e 'while true { sleep 0.1; }'" >@inp = @out = IO.popen(command,"w+") # this is the regular Ruby >popen > >#.... getting the pid of the ruby process (pid variable) > >Process.waitpid(pid) >puts "Process stopped" > >exit > >When I run this code I always get the following error: >waitpid: no child process (Process::Win32::ProcessError) > >I suspect that the reason for that is because the command I run >actually starts a CMD.exe program which in turn starts a ruby >program. The waitpid call operates on the pid of the ruby program >which is not the child but the grand-child of the current process. > >If I use the standard Ruby waitpid it works well. > >Do you see how I can solve this problem? Shall I use Process.create >with CREATE_NEW_CONSOLE flag instead of the IO.popen method? Would >this work better? > >Any advice is welcome > >Thanks for your help > >Laurent >-- >Laurent JULLIARD >Xerox Global Services >Manager, Smart Document Engineering >Tel: +33 (0)4 76 61 50 48 >Fax: +33 (0)4 76 61 51 99 From win32utils-devel at rubyforge.org Thu Nov 18 09:37:24 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 18 09:37:01 2004 Subject: [Win32utils-devel] Forward from Laurent Julliard Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0A7@itomae2km07.AD.QINTRA.COM> Let's try that again, without Hotmail's crappy formatting. Dan, I am one of the developer of the FreeRIDE project (the Ruby IDE) and I'm in charge of the FreeRIDE debugger with which we have had a number of problems on Windows now mostly due to the clunky implementation of IO/Process/Signal stuff on Win32. I recently came across your Win32 utils package and investigated the use of win32 process as a replacement for the native Ruby implementation. I currently have a problem which is the following: Somewhere in my code I have this: require 'win32/process' command = "start CMD /K ruby -e 'while true { sleep 0.1; }'" @inp = @out = IO.popen(command,"w+") # this is the regular Ruby popen #.... getting the pid of the ruby process (pid variable) Process.waitpid(pid) puts "Process stopped" exit When I run this code I always get the following error: waitpid: no child process (Process::Win32::ProcessError) I suspect that the reason for that is because the command I run actually starts a CMD.exe program which in turn starts a ruby program. The waitpid call operates on the pid of the ruby program which is not the child but the grand-child of the current process. If I use the standard Ruby waitpid it works well. Do you see how I can solve this problem? Shall I use Process.create with CREATE_NEW_CONSOLE flag instead of the IO.popen method? Would this work better? Any advice is welcome. Thanks for your help Laurent -- Laurent JULLIARD Xerox Global Services Manager, Smart Document Engineering Tel: +33 (0)4 76 61 50 48 Fax: +33 (0)4 76 61 51 99 From win32utils-devel at rubyforge.org Thu Nov 18 10:08:28 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 18 10:08:08 2004 Subject: [Win32utils-devel] Forward from Laurent Julliard References: <8FE83020B9E1A248A182A9B0A7B76E7358B0A7@itomae2km07.AD.QINTRA.COM> Message-ID: <007301c4cd80$75ede750$bcdefea9@2xnm9896kmqn5b9> Hi, > Let's try that again, without Hotmail's crappy formatting. > > Dan, > > I am one of the developer of the FreeRIDE project (the Ruby IDE) and I'm > in charge of the FreeRIDE debugger with which we have had a number of > problems on Windows now mostly due to the clunky implementation of > IO/Process/Signal stuff on Win32. I recently came across your Win32 > utils package and investigated the use of win32 process as a replacement > for the native Ruby implementation. I currently have a problem which is > the following: Somewhere in my code I have this: > > require 'win32/process' > command = "start CMD /K ruby -e 'while true { sleep 0.1; }'" > @inp = @out = IO.popen(command,"w+") # this is the regular Ruby popen > > #.... getting the pid of the ruby process (pid variable) > Process.waitpid(pid) > puts "Process stopped" > > exit > > When I run this code I always get the following error: > > waitpid: no child process (Process::Win32::ProcessError) > > I suspect that the reason for that is because the command I run actually > starts a CMD.exe program which in turn starts a ruby program. The > waitpid call operates on the pid of the ruby program which is not the > child but the grand-child of the current process. If I use the standard > Ruby waitpid it works well. Do you see how I can solve this problem? > Shall I use Process.create with CREATE_NEW_CONSOLE flag instead of the > IO.popen method? Would this work better? Any advice is welcome. > > Thanks for your help > > Laurent > -- The Process.waitpid of Win32::Process is only usable for pids generated by Win32::fork call. Win32::Process handles it's own array of pids not compatible with ruby native array of pids. So you cannot mix Win32::Process.wait and IO.popen. Regards, Park Heesob From win32utils-devel at rubyforge.org Sat Nov 20 22:52:49 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sat Nov 20 22:52:32 2004 Subject: [Win32utils-devel] SIGINT in win32-process Message-ID: Hi all, I banged my head all day trying to make SIGINT work like you would expect on Win32, to no avail. The goal is to allow the user to send a SIGINT (i.e. CTRL_C_EVENT) to a remote process. I tried a CreateRemoteThread() + GenerateConsoleCtrlEvent() approach with no luck. I also found this bit of code: http://www.mit.edu/afs/athena.mit.edu/contrib/xemacs/src/xemacs-21.4.4/src/process-nt.c But, I can't seem to make it, or my own attempts, work. For further clarification, here is what I'm trying to accomplish. Start this program on one console: # test.rb trap("SIGINT"){ puts "Got signal" exit } puts "PID: " + Process.pid.to_s while 1 puts "Hello" sleep 3 end Then, from another console, try to send Process.kill(2,pid) using win32-process. You will need to modify process_kill() in process.c slightly to make sure case 2 is the ctrl_c handler. Is what I'm trying to do even possible? Help wanted. Regards, Dan In the immortal words of Socrates, "I drank what?" From win32utils-devel at rubyforge.org Sun Nov 21 18:16:30 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sun Nov 21 18:16:37 2004 Subject: [Win32utils-devel] win32-file, overlapped added Message-ID: Hi all, I've got overlapped and offset support in both nread and nwrite. The only thing left before I want to release this (as 0.4.0) is to get NO_BUFFERING to work. Unfortunately, I can't get it to work. Park, I looked at that site you sent (and borrowed some code from it), but I don't see anything special happening for NO_BUFFERING. I thought it required VirtualAlloc() but I'm not sure. If anyone has any ideas on that, please let me know. Thanks. Regards, Dan From win32utils-devel at rubyforge.org Sun Nov 21 22:20:49 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Sun Nov 21 22:20:23 2004 Subject: [Win32utils-devel] win32-file, overlapped added Message-ID: <200411220320.iAM3Kn1I007755@localhost> Hi, > > Hi all, > > I've got overlapped and offset support in both nread and nwrite. The only > thing left before I want to release this (as 0.4.0) is to get NO_BUFFERING > to work. Unfortunately, I can't get it to work. > > Park, I looked at that site you sent (and borrowed some code from it), but I > don't see anything special happening for NO_BUFFERING. I thought it > required VirtualAlloc() but I'm not sure. > > If anyone has any ideas on that, please let me know. Thanks. > The problem is due to ReadFile cannot read large file at one call in case of larger than 0x3000000 bytes with NO_BUFFERING. I tested using while loop and it works. Just borrow some code from it again.:) > Regards, > > Dan > Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Mon Nov 22 13:52:08 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 22 13:51:39 2004 Subject: [Win32utils-devel] win32-file, overlapped added Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0B4@itomae2km07.AD.QINTRA.COM> > The problem is due to ReadFile cannot read large file at one > call in case of larger than 0x3000000 bytes with > NO_BUFFERING. I tested using while loop and it works. Just > borrow some code from it again.:) I must be dense, because even if I try to use that option on a small file, I get "the parameter is incorrect". What am I missing? Dan From win32utils-devel at rubyforge.org Mon Nov 22 19:26:00 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Mon Nov 22 19:25:31 2004 Subject: [Win32utils-devel] win32-file, overlapped added Message-ID: <200411230026.iAN0Q03Q016441@localhost> Hi, > > > The problem is due to ReadFile cannot read large file at one > > call in case of larger than 0x3000000 bytes with > > NO_BUFFERING. I tested using while loop and it works. Just > > borrow some code from it again.:) > > I must be dense, because even if I try to use that option on a small > file, I get "the parameter is incorrect". What am I missing? > > Dan > Here is my test code for case NO_BUFFERING: int getsectorcount(int x,char* str) { /*a function that returns number of sectors in file*sectorsize */ DWORD y[4]; if(GetDiskFreeSpace(str,&y[0],&y[1],&y[2],&y[3])==0) rb_raise(cFileError,ErrorDescription(GetLastError())); y[0]=x%y[1]; if(y[0]!=0)x+=y[1]-y[0]; return x; } /* * Uses the native ReadFile() behind the scenes. */ static VALUE file_nread(int argc, VALUE* argv, VALUE self){ OVERLAPPED olap; OpenFile *fptr; int fd; BOOL rv; HANDLE hFile; DWORD dwBytesToRead, dwBytesRead; int dwToRead, dwRead; VALUE rbLength, rbOffset, rbBuffer; char* lpBuffer = NULL; char* lpPtr = NULL; VALUE rbPath; char lpPath[256]; rbPath = file_get_path(self); strcpy(lpPath,StringValuePtr(rbPath)); lpPath[3] = 0; rb_scan_args(argc,argv,"02",&rbLength,&rbOffset); GetOpenFile(self, fptr); fd = _fileno(fptr->f); hFile = (HANDLE)_get_osfhandle(fd); memset(&olap, 0, sizeof(OVERLAPPED)); olap.Offset = 0; olap.OffsetHigh = 0; olap.hEvent = NULL; // TODO: Allow Win32::Event object if(Qnil != rbOffset) olap.Offset = NUM2INT(rbOffset); if(hFile == INVALID_HANDLE_VALUE) rb_raise(cFileError,ErrorDescription(GetLastError())); if(NIL_P(rbLength)){ dwBytesToRead = GetFileSize(hFile,NULL); } else{ dwBytesToRead = NUM2UINT(rbLength); } lpBuffer = malloc(getsectorcount(dwBytesToRead,lpPath)); memset(lpBuffer,0x00,dwBytesToRead); if(NULL == lpBuffer) rb_raise(cFileError,"malloc() call failed in nread() method"); lpPtr = lpBuffer; dwRead = 0; dwToRead = getsectorcount(dwBytesToRead,lpPath); if(dwBytesToRead>0x1000000) while(dwToRead>0) { if(dwToRead>0x1000000) rv = ReadFile( hFile, (LPVOID)lpPtr, 0x1000000, &dwRead, &olap ); else rv = ReadFile( hFile, (LPVOID)lpPtr, dwToRead, &dwRead, &olap ); if(0 == rv) rb_raise(cFileError,ErrorDescription(GetLastError())); lpPtr += 0x1000000; dwToRead -= 0x1000000; dwBytesRead += dwRead; } else { rv = ReadFile( hFile, (LPVOID)lpPtr, dwToRead, &dwBytesRead, &olap ); if(0 == rv) rb_raise(cFileError,ErrorDescription(GetLastError())); } if(dwBytesToRead != dwBytesRead) rb_raise(cFileError,"bytes to read != bytes actually read"); // This exchange is necessary so that we don't have a memory leak (I think) rbBuffer = rb_str_new(lpBuffer,dwBytesRead); free(lpBuffer); return rbBuffer; } Regards, Park Heesob --MIME Multi-part separator-- From win32utils-devel at rubyforge.org Tue Nov 23 23:00:38 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 23 23:00:10 2004 Subject: [Win32utils-devel] streams in fork Message-ID: <8d961d90041123200057db6320@mail.gmail.com> hi all, is there a way to use fork with redirected streams? i mean in a similar way that ruby's standard open3 does it. i'd like to be able to read the stdout/stdin/stderr streams from the forked ruby process in the parent process. cheers, aslak From win32utils-devel at rubyforge.org Wed Nov 24 11:49:16 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 24 11:48:42 2004 Subject: [Win32utils-devel] File.size implementation Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0B9@itomae2km07.AD.QINTRA.COM> Hi all, In light of the lack of 64 bit support on Windows, and a recent File.size thread, I've implemented File.size in win32-file using GetFileSizeEx(). I implemented it a class method of File itself. I should probably implement it as a method of File::Stat, but I didn't see an immediately obvious way to do that. Suggestions welcome. Dan From win32utils-devel at rubyforge.org Wed Nov 24 11:52:24 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Wed Nov 24 11:51:50 2004 Subject: [Win32utils-devel] streams in fork Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0BA@itomae2km07.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Tuesday, November 23, 2004 9:01 PM > To: win32utils-devel@rubyforge.org > Subject: [Win32utils-devel] streams in fork > > > hi all, > > is there a way to use fork with redirected streams? i mean in > a similar way that ruby's standard open3 does it. > > i'd like to be able to read the stdout/stdin/stderr streams > from the forked ruby process in the parent process. > > cheers, > aslak Do you mean so that you could create pipes using IO.popen for example? Not at the moment, but it's something I would like to have implemented at some point. If that's not what you meant, can you provide an example of what you wish to accomplish? Dan From win32utils-devel at rubyforge.org Thu Nov 25 21:03:23 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 25 21:03:23 2004 Subject: [Win32utils-devel] getdiskfreespace Message-ID: Hi all, I was just working on the FILE_FLAG_NO_BUFFERING stuff again. I'm a little confused about determining the cluster size. According to the MSDN docs, using GetDiskFreeSpace() on disks over 2GB may return incorrect values. Some threads on comp.os.ms-windows.* seem to support this as well. I did come across this, however: http://www.codeguru.com/Cpp/W-P/system/article.php/c2885/ On the other hand, it doesn't seem many people are using this, instead relying on GetDiskFreeSpace() regardless of disk size. Thoughts? Dan From win32utils-devel at rubyforge.org Thu Nov 25 22:22:01 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Thu Nov 25 22:22:28 2004 Subject: [Win32utils-devel] getdiskfreespace, revisited Message-ID: Further research indicates that GetDiskFreeSpace() is still ok for getting sector size, regardless of actual disk size. In any case, I'm going to default to 512 in the unlikely event that the call fails, rather than raise an error. Dan From win32utils-devel at rubyforge.org Tue Nov 30 14:15:55 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 30 14:15:15 2004 Subject: [Win32utils-devel] $LOAD_PATH patch Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0C3@itomae2km07.AD.QINTRA.COM> Hey all, I dunno if anyone else saw http://rubyforge.org/tracker/index.php?func=detail&aid=1087&group_id=85& atid=413 I just noticed it today (ack!) - I now have a monitor on patches. :) Any thoughts? Dan From win32utils-devel at rubyforge.org Tue Nov 30 15:16:02 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 30 15:15:15 2004 Subject: [Win32utils-devel] $LOAD_PATH patch In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B0C3@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B0C3@itomae2km07.AD.QINTRA.COM> Message-ID: <8d961d9004113012166bbc5028@mail.gmail.com> On Tue, 30 Nov 2004 13:15:55 -0600, win32utils-devel@rubyforge.org wrote: > Hey all, > > I dunno if anyone else saw > http://rubyforge.org/tracker/index.php?func=detail&aid=1087&group_id=85& > atid=413 > > I just noticed it today (ack!) - I now have a monitor on patches. :) > > Any thoughts? > It's my patch - I think it's good ;-) Aslak > Dan > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From win32utils-devel at rubyforge.org Tue Nov 30 15:18:27 2004 From: win32utils-devel at rubyforge.org (win32utils-devel@rubyforge.org) Date: Tue Nov 30 15:17:41 2004 Subject: [Win32utils-devel] $LOAD_PATH patch Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B0C8@itomae2km07.AD.QINTRA.COM> > > It's my patch - I think it's good ;-) > > Aslak Hehe. It may be a couple days before I get to tinker with it, but I'll definitely take a look. Mainly I just wanted to make sure that Park saw it. :) Regards, Dan