From batkins57 at gmail.com Thu Aug 11 10:39:02 2005 From: batkins57 at gmail.com (Bill Atkins) Date: Thu Aug 11 10:32:55 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint = strange behavior In-Reply-To: <66b7e34b050811072552697ea9@mail.gmail.com> References: <66b7e34b050811072552697ea9@mail.gmail.com> Message-ID: <66b7e34b05081107396fb38c26@mail.gmail.com> I'm getting really strange behavior with win32/process. Here's the code: ----- require 'win32/process' require_gem 'ruby-breakpoint' x = Process.create :app_name => "ruby bin/run_device.rb devices/terminal_server.rb" puts "done" puts "done" Process.kill 9, x puts "done" ------ Running this code gives me a segfault ---- C:\development\simulation>ruby ptest.rb done done ptest.rb:9: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. C:\development\simulation> ----- But if I remove one of the "puts "done"" lines, it works correctly. It seems that if I have two puts's in a row anywhere, I get a segfault when I kill the process. This only occurs if ruby-breakpoint is loaded. This is fairly bizarre. It's not a severe issue, because I can get by without ruby-breakpoint, but does this happen to anyone else? -- Bill Atkins -- Bill Atkins From Daniel.Berger at qwest.com Thu Aug 11 16:02:11 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu Aug 11 15:56:07 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint = strangebehavior Message-ID: <39AA6550E5AA554AB1456707D6E5563D0DCC9A@QTOMAE2K3M01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > Bill Atkins > Sent: Thursday, August 11, 2005 8:39 AM > To: win32utils-devel@rubyforge.org > Subject: [Win32utils-devel] win32-process + ruby-breakpoint = > strangebehavior > > > I'm getting really strange behavior with win32/process. > Here's the code: > > ----- > require 'win32/process' > require_gem 'ruby-breakpoint' > > x = Process.create :app_name => "ruby bin/run_device.rb > devices/terminal_server.rb" > > puts "done" > puts "done" > > Process.kill 9, x > > puts "done" > ------ > > Running this code gives me a segfault > > ---- > C:\development\simulation>ruby ptest.rb > done > done > ptest.rb:9: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > > This application has requested the Runtime to terminate it > in an unusual way. > Please contact the application's support team for more information. > > C:\development\simulation> > ----- > > But if I remove one of the "puts "done"" lines, it works > correctly. It seems that if I have two puts's in a row > anywhere, I get a segfault when I kill the process. This > only occurs if ruby-breakpoint is loaded. > > This is fairly bizarre. It's not a severe issue, because I > can get by without ruby-breakpoint, but does this happen to > anyone else? I could certainly use a second pair of eyes to look over win32-process to see what might be causing this. Heesob? Regards, Dan From phasis at nownuri.net Thu Aug 11 21:06:19 2005 From: phasis at nownuri.net (Park Heesob) Date: Thu Aug 11 21:00:12 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint =strangebehavior References: <39AA6550E5AA554AB1456707D6E5563D0DCC9A@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <008801c59eda$0ca5d1a0$f80d5bd2@2xnm9896kmqn5b9> Hi, >> -----Original Message----- >> From: win32utils-devel-bounces@rubyforge.org >> [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of >> Bill Atkins >> Sent: Thursday, August 11, 2005 8:39 AM >> To: win32utils-devel@rubyforge.org >> Subject: [Win32utils-devel] win32-process + ruby-breakpoint = >> strangebehavior >> >> >> I'm getting really strange behavior with win32/process. >> Here's the code: >> >> ----- >> require 'win32/process' >> require_gem 'ruby-breakpoint' >> >> x = Process.create :app_name => "ruby bin/run_device.rb >> devices/terminal_server.rb" >> >> puts "done" >> puts "done" >> >> Process.kill 9, x >> >> puts "done" >> ------ >> >> Running this code gives me a segfault >> >> ---- >> C:\development\simulation>ruby ptest.rb >> done >> done >> ptest.rb:9: [BUG] Segmentation fault >> ruby 1.8.2 (2004-12-25) [i386-mswin32] >> > > I could certainly use a second pair of eyes to look over win32-process > to see what might be causing this. Heesob? > > Regards, > > Dan > I fixed the bug. it was due to the child_pids array. Check out the latest CVS version. Regards, Park Heesob PS. I'm working on libgmailer for now . it is almost same as libgmailer for PHP (http://gmail-lite.sourceforge.net/ ). It is almost done except for sending message with attachments. What do you think about this? It might be useful? From djberg96 at gmail.com Sat Aug 13 18:58:55 2005 From: djberg96 at gmail.com (Daniel Berger) Date: Sat Aug 13 18:52:43 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint =strangebehavior In-Reply-To: <008801c59eda$0ca5d1a0$f80d5bd2@2xnm9896kmqn5b9> References: <39AA6550E5AA554AB1456707D6E5563D0DCC9A@QTOMAE2K3M01.AD.QINTRA.COM> <008801c59eda$0ca5d1a0$f80d5bd2@2xnm9896kmqn5b9> Message-ID: <6037b70c050813155840b49803@mail.gmail.com> On 8/11/05, Park Heesob wrote: > PS. I'm working on libgmailer for now . it is almost same as libgmailer for > PHP > (http://gmail-lite.sourceforge.net/ ). > It is almost done except for sending message with attachments. > What do you think about this? It might be useful? Interesting. Are you working on some sort of Ruby interface for gmail? Or just on gmail-lite itself? Dan From phasis at nownuri.net Sat Aug 13 20:40:22 2005 From: phasis at nownuri.net (Park Heesob) Date: Sat Aug 13 20:34:11 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint=strangebehavior References: <39AA6550E5AA554AB1456707D6E5563D0DCC9A@QTOMAE2K3M01.AD.QINTRA.COM><008801c59eda$0ca5d1a0$f80d5bd2@2xnm9896kmqn5b9> <6037b70c050813155840b49803@mail.gmail.com> Message-ID: <004401c5a068$c139a2b0$e30d5bd2@2xnm9896kmqn5b9> Hi, > On 8/11/05, Park Heesob wrote: > >> PS. I'm working on libgmailer for now . it is almost same as libgmailer >> for >> PHP >> (http://gmail-lite.sourceforge.net/ ). >> It is almost done except for sending message with attachments. >> What do you think about this? It might be useful? > > Interesting. Are you working on some sort of Ruby interface for > gmail? Or just on gmail-lite itself? > > Dan > I think the libgmailer is a libary module, but gmail-lite is an application. I'm working on libgmailer library module not gmail-lite. I found this module is equivalent to Perl's Mail::Webmail::Gmail module. Regards, Park Heesob From sdate at everestkc.net Sat Aug 13 21:18:55 2005 From: sdate at everestkc.net (Shashank Date) Date: Sat Aug 13 21:12:53 2005 Subject: [Win32utils-devel] win32-process + ruby-breakpoint=strangebehavior In-Reply-To: <004401c5a068$c139a2b0$e30d5bd2@2xnm9896kmqn5b9> References: <39AA6550E5AA554AB1456707D6E5563D0DCC9A@QTOMAE2K3M01.AD.QINTRA.COM> <008801c59eda$0ca5d1a0$f80d5bd2@2xnm9896kmqn5b9> <6037b70c050813155840b49803@mail.gmail.com> <004401c5a068$c139a2b0$e30d5bd2@2xnm9896kmqn5b9> Message-ID: <42FE9BFF.2000103@everestkc.net> Hi Park, Park Heesob wrote: >I think the libgmailer is a libary module, but gmail-lite is an application. >I'm working on libgmailer library module not gmail-lite. > >I found this module is equivalent to Perl's Mail::Webmail::Gmail module. > > I find this foray of yours very interesting and am wondering what it would take to create the gmail-lite app. My interest stems from the fact that it is written for PDA and mobile devices, which also my current focus. Please keep me (us) informed. I would like to work on the gmail-lite in Ruby. Can I get a snapshot preview of the library somewhere? Thanks, -- Shashank From Daniel.Berger at qwest.com Fri Aug 19 11:33:30 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Fri Aug 19 11:27:09 2005 Subject: [Win32utils-devel] File.basename issue Message-ID: <39AA6550E5AA554AB1456707D6E5563D0DCCC1@QTOMAE2K3M01.AD.QINTRA.COM> Hi all, After a recent ruby-talk thread I decided to go back and refactor the File.basename method in win32-file. Sure enough, after a I added some more tests I discovered a couple minor bugs. After reworking it, I still can't get one test to pass. Specifically, multiple trailing slashes. Here's the test that shows the issue: assert_equal("bar", File.basename("C:/foo/bar\\\\")) Instead of "bar", I end up with "bar\" because I only call PathRemoveBackslash() once. I figured I could solve it with something like this: while(PathRemoveBackslash(path)){} But that doesn't work. I thought you could just call this until you hit NULL, but I can't seem to make it work. I suspect the answer is easy, I'm just not seeing it for some reason. Ideas? Dan From phasis at nownuri.net Fri Aug 19 21:04:58 2005 From: phasis at nownuri.net (Park Heesob) Date: Fri Aug 19 20:58:33 2005 Subject: [Win32utils-devel] File.basename issue References: <39AA6550E5AA554AB1456707D6E5563D0DCCC1@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <003701c5a523$2f39c240$e70d5bd2@2xnm9896kmqn5b9> Hi Dan, > Hi all, > > After a recent ruby-talk thread I decided to go back and refactor the > File.basename method in win32-file. Sure enough, after a I added some > more tests I discovered a couple minor bugs. > > After reworking it, I still can't get one test to pass. Specifically, > multiple trailing slashes. Here's the test that shows the issue: > > assert_equal("bar", File.basename("C:/foo/bar\\\\")) > > Instead of "bar", I end up with "bar\" because I only call > PathRemoveBackslash() once. I figured I could solve it with something > like this: > > while(PathRemoveBackslash(path)){} > > But that doesn't work. I thought you could just call this until you hit > NULL, but I can't seem to make it work. I suspect the answer is easy, > I'm just not seeing it for some reason. > > Ideas? > > Dan > The msdn document reads Returns the address of the NULL that replaced the backslash, or the address of the last character if it's not a backslash. ^^^^^^^^^^^^^^^^ You should use while(!*PathRemoveBackslash(path)); Regards, Park Heesob From djberg96 at gmail.com Sat Aug 20 20:10:15 2005 From: djberg96 at gmail.com (Daniel Berger) Date: Sat Aug 20 20:04:03 2005 Subject: [Win32utils-devel] File.basename issue In-Reply-To: <003701c5a523$2f39c240$e70d5bd2@2xnm9896kmqn5b9> References: <39AA6550E5AA554AB1456707D6E5563D0DCCC1@QTOMAE2K3M01.AD.QINTRA.COM> <003701c5a523$2f39c240$e70d5bd2@2xnm9896kmqn5b9> Message-ID: <4307C667.6070506@gmail.com> Park Heesob wrote: > Hi Dan, > > The msdn document reads > Returns the address of the NULL that replaced the backslash, or the > address of the last character if it's not a backslash. > > ^^^^^^^^^^^^^^^^ > > You should use > > while(!*PathRemoveBackslash(path)); > > Regards, > > Park Heesob Dang, I thought I tried that and it didn't work. I must have done something wrong. Thanks! Dan From Daniel.Berger at qwest.com Wed Aug 24 11:12:46 2005 From: Daniel.Berger at qwest.com (Daniel Berger) Date: Wed Aug 24 11:06:55 2005 Subject: [Win32utils-devel] Re: Windows administration & Ruby In-Reply-To: <430B858C.6010106@whitneydrive.me.uk> References: <430B858C.6010106@whitneydrive.me.uk> Message-ID: <430C8E6E.8080507@qwest.com> Hi Graham, Graham Foster wrote: > I have a Perl administration script with automatically adds/removes > users from Windows groups. I need to make some changes to how it works, > and I was considering re-writing it in Ruby... however I cannot find the > necessary packages. I've had a look at your win32utils - but cannot find > a section on permissions management. Do you know of one? > > > I use the following Perl packages/methods > Win32::NetAdmin::LocalGroupGetAttributes > Win32::NetAdmin::LocalGroupCreate > Win32::NetAdmin::LocalGroupIsMember > Win32::NetAdmin::LocalGroupAddUsers > Win32::NetAdmin::LocalGroupDeleteUsers > > Thx > Graham At the moment you should be able to use win32-etc for your purposes. Note that I am in the process of adding support for adding, deleting and configuring users and groups to the sys-admin package, which will supercede the win32-etc package, so keep an eye out. :) Regards, Dan