From noreply at rubyforge.org Sun Jan 9 09:55:43 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 09:55:43 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-28840 ] wrong process_id is returned if using create multiple times for IE Message-ID: <20110109145543.6A623185834E@rubyforge.org> Bugs item #28840, was opened at 2011-01-09 16:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: wrong process_id is returned if using create multiple times for IE Initial Comment: Hi. Execute in IRB: require "win32/process" proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc1.process_id # works proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") proc2 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc2.process_id # doesn't work because the proc2.process_id doesn't exist anymore Any ideas why the proc2 process_id will not exist right after starting it? It is possible to see that it exists for a brief time with Process Explorer, but will be gone. How to get the "correct" PID? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 From noreply at rubyforge.org Sun Jan 9 09:58:15 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 09:58:15 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Feature Requests-28841 ] Why not create fat binary gems for all win32 utils gems? Message-ID: <20110109145815.4708F185835E@rubyforge.org> Feature Requests item #28841, was opened at 2011-01-09 16:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: Why not create fat binary gems for all win32 utils gems? Initial Comment: Currently if you install any of the win32-* gems then it will work only with Ruby 1.8.x due to the precompiled binary for that version. Why not create a pre-compiled versions for 1.9.x too and package them as a so called fat-binary gems? This would make all those gems (probably) work with 1.9 Ruby too. Currently many gems cannot be used in 1.9 because they're using win32-* gems as a dependency. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 From noreply at rubyforge.org Sun Jan 9 10:51:30 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 10:51:30 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-28840 ] wrong process_id is returned if using create multiple times for IE Message-ID: <20110109155130.112601858361@rubyforge.org> Bugs item #28840, was opened at 2011-01-09 07:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: wrong process_id is returned if using create multiple times for IE Initial Comment: Hi. Execute in IRB: require "win32/process" proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc1.process_id # works proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") proc2 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc2.process_id # doesn't work because the proc2.process_id doesn't exist anymore Any ideas why the proc2 process_id will not exist right after starting it? It is possible to see that it exists for a brief time with Process Explorer, but will be gone. How to get the "correct" PID? ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2011-01-09 08:51 Message: Which version of IE and Windows? Do you see the same behavior with other applications, such as notepad? Some applications on Windows automatically relaunch themselves as remote threads of an already existing process. I've seen this in the past with Firefox, for example. One way to test this is to launch the process explorer, then launch multiple instances of IE. If you still only see one IE process, then that's what's happening. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 From noreply at rubyforge.org Sun Jan 9 11:35:54 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 11:35:54 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Feature Requests-28841 ] Why not create fat binary gems for all win32 utils gems? Message-ID: <20110109163554.8BFC2185831A@rubyforge.org> Feature Requests item #28841, was opened at 2011-01-09 11:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: Why not create fat binary gems for all win32 utils gems? Initial Comment: Currently if you install any of the win32-* gems then it will work only with Ruby 1.8.x due to the precompiled binary for that version. Why not create a pre-compiled versions for 1.9.x too and package them as a so called fat-binary gems? This would make all those gems (probably) work with 1.9 Ruby too. Currently many gems cannot be used in 1.9 because they're using win32-* gems as a dependency. ---------------------------------------------------------------------- Comment By: Luis Lavena (luislavena) Date: 2011-01-09 13:35 Message: Hello, Me chiming in. To be able to create the fat-binary gems you need Linux, as currently rake-compiler, the only project able to generate these automatically, only support that functionality on non-Windows platforms. It is in the Roadmap, but no ETA. So, either the fat-binary gems need to be created manually or on a non-Windows platform that support rake-compiler. Daniel, feel free to contact me at RubyInstaller list to discuss this. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 From noreply at rubyforge.org Sun Jan 9 11:41:12 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 11:41:12 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-28840 ] wrong process_id is returned if using create multiple times for IE Message-ID: <20110109164112.B546A185834E@rubyforge.org> Bugs item #28840, was opened at 2011-01-09 16:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: wrong process_id is returned if using create multiple times for IE Initial Comment: Hi. Execute in IRB: require "win32/process" proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc1.process_id # works proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") proc2 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc2.process_id # doesn't work because the proc2.process_id doesn't exist anymore Any ideas why the proc2 process_id will not exist right after starting it? It is possible to see that it exists for a brief time with Process Explorer, but will be gone. How to get the "correct" PID? ---------------------------------------------------------------------- >Comment By: Jarmo Pertman (juuser) Date: 2011-01-09 18:41 Message: The problem is reproducable on windows 7 64bit and windows xp 32bit with IE8. It seems to happen "only" with IE and when using process explorer then i can see that the process with "correct id" is killed quite right after started. Although there won't be only one iexplore.exe left, but the count of processes will increase after each Process.create. Under win7 i will have 3 iexplore.exe's running when using Process.create 2 times. Under xp 2. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2011-01-09 17:51 Message: Which version of IE and Windows? Do you see the same behavior with other applications, such as notepad? Some applications on Windows automatically relaunch themselves as remote threads of an already existing process. I've seen this in the past with Firefox, for example. One way to test this is to launch the process explorer, then launch multiple instances of IE. If you still only see one IE process, then that's what's happening. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 From noreply at rubyforge.org Sun Jan 9 11:44:48 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 11:44:48 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Feature Requests-28841 ] Why not create fat binary gems for all win32 utils gems? Message-ID: <20110109164448.6543C185834E@rubyforge.org> Feature Requests item #28841, was opened at 2011-01-09 16:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: Why not create fat binary gems for all win32 utils gems? Initial Comment: Currently if you install any of the win32-* gems then it will work only with Ruby 1.8.x due to the precompiled binary for that version. Why not create a pre-compiled versions for 1.9.x too and package them as a so called fat-binary gems? This would make all those gems (probably) work with 1.9 Ruby too. Currently many gems cannot be used in 1.9 because they're using win32-* gems as a dependency. ---------------------------------------------------------------------- >Comment By: Jarmo Pertman (juuser) Date: 2011-01-09 18:44 Message: Luis, that would be great if you'd be able to help out to make win32 gems work under 1.9 too. As stated in my original request then they're playing quite big part of many other gems and are affecting Windows Ruby users experience negatively on Ruby 1.9. ---------------------------------------------------------------------- Comment By: Luis Lavena (luislavena) Date: 2011-01-09 18:35 Message: Hello, Me chiming in. To be able to create the fat-binary gems you need Linux, as currently rake-compiler, the only project able to generate these automatically, only support that functionality on non-Windows platforms. It is in the Roadmap, but no ETA. So, either the fat-binary gems need to be created manually or on a non-Windows platform that support rake-compiler. Daniel, feel free to contact me at RubyInstaller list to discuss this. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=28841&group_id=85 From noreply at rubyforge.org Sun Jan 9 11:49:11 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 11:49:11 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-28840 ] wrong process_id is returned if using create multiple times for IE Message-ID: <20110109164911.AD0D0185834E@rubyforge.org> Bugs item #28840, was opened at 2011-01-09 07:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: wrong process_id is returned if using create multiple times for IE Initial Comment: Hi. Execute in IRB: require "win32/process" proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc1.process_id # works proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") proc2 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc2.process_id # doesn't work because the proc2.process_id doesn't exist anymore Any ideas why the proc2 process_id will not exist right after starting it? It is possible to see that it exists for a brief time with Process Explorer, but will be gone. How to get the "correct" PID? ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2011-01-09 09:49 Message: Please try creating 3 processes using your code above, but comment out the parts that kills them. Then fire up Process explorer and see if they're there. Regards, Dan ---------------------------------------------------------------------- Comment By: Jarmo Pertman (juuser) Date: 2011-01-09 09:41 Message: The problem is reproducable on windows 7 64bit and windows xp 32bit with IE8. It seems to happen "only" with IE and when using process explorer then i can see that the process with "correct id" is killed quite right after started. Although there won't be only one iexplore.exe left, but the count of processes will increase after each Process.create. Under win7 i will have 3 iexplore.exe's running when using Process.create 2 times. Under xp 2. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2011-01-09 08:51 Message: Which version of IE and Windows? Do you see the same behavior with other applications, such as notepad? Some applications on Windows automatically relaunch themselves as remote threads of an already existing process. I've seen this in the past with Firefox, for example. One way to test this is to launch the process explorer, then launch multiple instances of IE. If you still only see one IE process, then that's what's happening. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 From noreply at rubyforge.org Sun Jan 9 12:20:33 2011 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 9 Jan 2011 12:20:33 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-28840 ] wrong process_id is returned if using create multiple times for IE Message-ID: <20110109172033.5B476185834E@rubyforge.org> Bugs item #28840, was opened at 2011-01-09 16:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jarmo Pertman (juuser) Assigned to: Nobody (None) Summary: wrong process_id is returned if using create multiple times for IE Initial Comment: Hi. Execute in IRB: require "win32/process" proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc1.process_id # works proc1 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") proc2 = Process.create(:app_name => "C:\Program Files (x86)\Internet Explorer\iexplore.exe about:blank") Process.kill 9, proc2.process_id # doesn't work because the proc2.process_id doesn't exist anymore Any ideas why the proc2 process_id will not exist right after starting it? It is possible to see that it exists for a brief time with Process Explorer, but will be gone. How to get the "correct" PID? ---------------------------------------------------------------------- >Comment By: Jarmo Pertman (juuser) Date: 2011-01-09 19:20 Message: On win7 i have 4 processes after running Process.create 3 times and only first one has the pid reported by Process.create for the first time. It seems indeed that there is somekind of an "optimization" going on. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2011-01-09 18:49 Message: Please try creating 3 processes using your code above, but comment out the parts that kills them. Then fire up Process explorer and see if they're there. Regards, Dan ---------------------------------------------------------------------- Comment By: Jarmo Pertman (juuser) Date: 2011-01-09 18:41 Message: The problem is reproducable on windows 7 64bit and windows xp 32bit with IE8. It seems to happen "only" with IE and when using process explorer then i can see that the process with "correct id" is killed quite right after started. Although there won't be only one iexplore.exe left, but the count of processes will increase after each Process.create. Under win7 i will have 3 iexplore.exe's running when using Process.create 2 times. Under xp 2. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2011-01-09 17:51 Message: Which version of IE and Windows? Do you see the same behavior with other applications, such as notepad? Some applications on Windows automatically relaunch themselves as remote threads of an already existing process. I've seen this in the past with Firefox, for example. One way to test this is to launch the process explorer, then launch multiple instances of IE. If you still only see one IE process, then that's what's happening. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=28840&group_id=85 From djberg96 at gmail.com Tue Jan 11 21:17:35 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 11 Jan 2011 19:17:35 -0700 Subject: [Win32utils-devel] gcc warning compiling win32-api Message-ID: <4D2D0F3F.4060106@gmail.com> Greetings, I built 1.9.2 from source using mingw & gcc 3.4.5 on Windows 7. Seemed to go fine. When I build win32-api, I see these warnings: win32/api.c:691: warning: missing braces around initializer Any suggestions on how to remove these warnings? Randomly futzing around with brackets isn't working for me today. ;) Regards, Dan From djberg96 at gmail.com Sun Jan 16 14:10:22 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 16 Jan 2011 12:10:22 -0700 Subject: [Win32utils-devel] win32-api 1.4.8 released Message-ID: <000301cbb5b1$07a65050$16f2f0f0$@com> Hey folks, I've pushed out win32-api-1.4.8 just now. The binary distro contains binaries for both Ruby 1.8 and Ruby 1.9. Please let me know if there any problems. Seemed to work fine in testing. Dan From djberg96 at gmail.com Mon Jan 17 23:01:43 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 17 Jan 2011 21:01:43 -0700 Subject: [Win32utils-devel] Windows platform detection Message-ID: <4D3510A7.1030002@gmail.com> Hi, Is there any reason we can't use this to detect Windows? File::PATH_SEPARATOR == ';' Is there any other platform that uses ';' as a path separator? Regards, Dan From luislavena at gmail.com Tue Jan 18 06:44:15 2011 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Jan 2011 08:44:15 -0300 Subject: [Win32utils-devel] Windows platform detection In-Reply-To: <4D3510A7.1030002@gmail.com> References: <4D3510A7.1030002@gmail.com> Message-ID: On Tue, Jan 18, 2011 at 1:01 AM, Daniel Berger wrote: > Hi, > > Is there any reason we can't use this to detect Windows? > > File::PATH_SEPARATOR == ';' > > Is there any other platform that uses ';' as a path separator? > If you're doing cross-compilation, that can't be used as is not been set. mkmf extensions that contain code that depends on the platform will not be able to be cross compiled if you use that. RUBY_PLATFORM and File::ALT_SEPARATOR are the only ones been set. Normally ALT_SEPARATOR is nil on every platform except Windows. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From djberg96 at gmail.com Tue Jan 18 08:01:10 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 18 Jan 2011 06:01:10 -0700 Subject: [Win32utils-devel] Windows platform detection In-Reply-To: References: <4D3510A7.1030002@gmail.com> Message-ID: <4D358F16.4090701@gmail.com> On 1/18/11 4:44 AM, Luis Lavena wrote: > On Tue, Jan 18, 2011 at 1:01 AM, Daniel Berger wrote: >> Hi, >> >> Is there any reason we can't use this to detect Windows? >> >> File::PATH_SEPARATOR == ';' >> >> Is there any other platform that uses ';' as a path separator? >> > > If you're doing cross-compilation, that can't be used as is not been set. > > mkmf extensions that contain code that depends on the platform will > not be able to be cross compiled if you use that. > > RUBY_PLATFORM and File::ALT_SEPARATOR are the only ones been set. > Normally ALT_SEPARATOR is nil on every platform except Windows. > Based on this: http://en.wikipedia.org/wiki/Path_(computing) I'm guessing that File::ALT_SEPARATOR could be non-nil on some of those platforms. OpenVMS, for instance. I've never built Ruby on OpenVMS, so I can't say for sure. Besides cross-compiling is THE DEVIL. Dan From luislavena at gmail.com Tue Jan 18 08:38:22 2011 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Jan 2011 10:38:22 -0300 Subject: [Win32utils-devel] Windows platform detection In-Reply-To: <4D358F16.4090701@gmail.com> References: <4D3510A7.1030002@gmail.com> <4D358F16.4090701@gmail.com> Message-ID: On Tue, Jan 18, 2011 at 10:01 AM, Daniel Berger wrote: > > Besides cross-compiling is THE DEVIL. > But sometimes you need to deal with the devil. In my experience cross-compilation options had helped me increase gem authors to care about providing binaries for Windows, even complex ones like nokogiri that depends on libxml2 Without making deals with the devil, lot of gems will be lacking proper support or binaries for Windows. As for the ALT_SEPARATOR, From the link you provide cannot see how that will be non-nil. You can ask Ruby-Core. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From djberg96 at gmail.com Tue Jan 18 20:42:14 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 18 Jan 2011 18:42:14 -0700 Subject: [Win32utils-devel] Windows platform detection In-Reply-To: References: <4D3510A7.1030002@gmail.com> Message-ID: <4D364176.6060109@gmail.com> On 1/18/11 4:44 AM, Luis Lavena wrote: > On Tue, Jan 18, 2011 at 1:01 AM, Daniel Berger wrote: > RUBY_PLATFORM and File::ALT_SEPARATOR are the only ones been set. > Normally ALT_SEPARATOR is nil on every platform except Windows. > Looking at defines.h I see this: #if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) #define DOSISH 1 #ifndef _WIN32_WCE # define DOSISH_DRIVE_LETTER #endif #endif Wikipedia tells me that human68k is an OS for a Sharp workstation. EMX is a programming environment for DOS and OS/2. Ruby's file.c simply makes this check: #ifdef DOSISH rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_str_new2("\\"))); #else rb_define_const(rb_cFile, "ALT_SEPARATOR", Qnil); #endif Hm, maybe I have nothing to worry about after all. I *thought* the configure script would be a little more robust than that, but I guess not. Anyway, I guess I'll go back to using File::ALT_SEPARATOR after all since I don't care about Sharp's OS, and the rest are one DOS environment or another. Regards, Dan From djberg96 at gmail.com Mon Jan 24 21:20:56 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 24 Jan 2011 19:20:56 -0700 Subject: [Win32utils-devel] Filesystem monitoring and ExecNotificationQuery Message-ID: <001801cbbc36$81853e00$848fba00$@com> Hi, I thought I'd attempt a pure Ruby version of win32-changejournal. I came across this post: http://www.codeproject.com/Articles/42212/WMI-and-File-System-Monitoring.asp x Within it he uses ExecNotificationQuery. However, I can't make it work. I tried this snippet: # test.rb require 'win32ole' require 'socket' host = Socket.gethostname con = "winmgmts://#{host}/root/cimv2" wmi = WIN32OLE.connect(con) drive = "C:" folder = "\\Users\\djberge" sql = %Q{ select * from __InstanceOperationEvent within 2 where TargetInstance isa 'CIM_DataFile' and TargetInstance.Drive='#{drive}' and TargetInstance.Path='#{folder}' } events = wmi.ExecNotificationQuery(sql) # end test.rb Here were the results: c:\Users\djberge >ruby test.rb test.rb:20:in `method_missing': ExecNotificationQuery (WIN32OLERuntimeError) OLE error code:80041058 in SWbemServicesEx Unparsable query. HRESULT error code:0x80020009 Exception occurred. from test.rb:20 Tried it with JRuby, too: c:\Users\djberge >jruby test.rb Dispatch.java:-2:in `invokev': org.racob.com.ComFailException: Invoke of: ExecNotificationQuery Source: SWbemServicesEx Description: Unparsable query. from Dispatch.java:243:in `invokev' from Dispatch.java:187:in `callN' from RubyWIN32OLE.java:203:in `invokeMethodOrGet' from RubyWIN32OLE.java:112:in `method_missing' from org/jruby/ext/win32ole/RubyWIN32OLE$i_method_0_0$RUBYINVOKER$method_missing. gen:65535:in `call' from JavaMethod.java:642:in `call' from RuntimeHelpers.java:401:in `call' from DynamicMethod.java:190:in `call' from CachingCallSite.java:375:in `callMethodMissing' from CachingCallSite.java:306:in `cacheAndCall' from CachingCallSite.java:148:in `call' from test.rb:20:in `__file__' from test.rb:-1:in `load' from Ruby.java:690:in `runScript' from Ruby.java:573:in `runNormally' from Ruby.java:416:in `runFromMain' from Main.java:286:in `run' from Main.java:128:in `run' from Main.java:97:in `main' Any ideas? Regards, Dan From phasis at gmail.com Tue Jan 25 00:32:36 2011 From: phasis at gmail.com (Heesob Park) Date: Tue, 25 Jan 2011 14:32:36 +0900 Subject: [Win32utils-devel] Filesystem monitoring and ExecNotificationQuery In-Reply-To: <001801cbbc36$81853e00$848fba00$@com> References: <001801cbbc36$81853e00$848fba00$@com> Message-ID: Hi, 2011/1/25 Daniel Berger : > Hi, > > I thought I'd attempt a pure Ruby version of win32-changejournal. I came > across this post: > > http://www.codeproject.com/Articles/42212/WMI-and-File-System-Monitoring.asp > x > > Within it he uses ExecNotificationQuery. However, I can't make it work. I > tried this snippet: > ... > > Any ideas? > It seems that folder's separator must be "\\\\". Here is a working sample: # test.rb require 'win32ole' require 'socket' host = Socket.gethostname con = "winmgmts://#{host}/root/cimv2" wmi = WIN32OLE.connect(con) drive = "C:" folder = "\\\\Users\\\\phasis" sql = %Q{ select * from __InstanceOperationEvent within 2 where TargetInstance isa 'CIM_DataFile' and TargetInstance.Drive='#{drive}' and TargetInstance.Path='#{folder}\\\\' } events = wmi.ExecNotificationQuery(sql) while event = events.NextEvent case event.Path_.Class when "__InstanceCreationEvent" puts "A new file was just created: #{event.TargetInstance.FileName}" when "__InstanceModificationEvent" puts "A file was just modified: #{event.TargetInstance.FileName}" when "__InstanceDeletionEvent" puts "A file was just deleted: #{event.TargetInstance.FileName}" end end # end test.rb Regards, Park Heesob From djberg96 at gmail.com Wed Jan 26 06:28:57 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 26 Jan 2011 04:28:57 -0700 Subject: [Win32utils-devel] Filesystem monitoring and ExecNotificationQuery In-Reply-To: References: <001801cbbc36$81853e00$848fba00$@com> Message-ID: On Mon, Jan 24, 2011 at 10:32 PM, Heesob Park wrote: > Hi, > > 2011/1/25 Daniel Berger : >> Hi, >> >> I thought I'd attempt a pure Ruby version of win32-changejournal. I came >> across this post: >> >> http://www.codeproject.com/Articles/42212/WMI-and-File-System-Monitoring.asp >> x >> >> Within it he uses ExecNotificationQuery. However, I can't make it work. I >> tried this snippet: >> > ... >> >> Any ideas? >> > It seems that folder's separator must be "\\\\". > Here is a working sample: > > # test.rb > require 'win32ole' > require 'socket' > > host = Socket.gethostname > con = "winmgmts://#{host}/root/cimv2" > wmi = WIN32OLE.connect(con) > drive ?= "C:" > folder = "\\\\Users\\\\phasis" > > sql = %Q{ > ?select * > ?from __InstanceOperationEvent > ?within 2 > ?where TargetInstance isa 'CIM_DataFile' > ?and TargetInstance.Drive='#{drive}' > ?and TargetInstance.Path='#{folder}\\\\' > } > events = wmi.ExecNotificationQuery(sql) > while > ? ? ? ?event = events.NextEvent > ? ? ? ?case event.Path_.Class > ? ? ? ?when "__InstanceCreationEvent" > ? ? ? ? ? ? ? ?puts "A new file was just created: #{event.TargetInstance.FileName}" > ? ? ? ?when "__InstanceModificationEvent" > ? ? ? ? ? ? ? ?puts "A file was just modified: #{event.TargetInstance.FileName}" > ? ? ? ?when "__InstanceDeletionEvent" > ? ? ? ? ? ? ? ?puts "A file was just deleted: #{event.TargetInstance.FileName}" > ? ? ? ?end > end > # end test.rb > > > Regards, > Park Heesob Excellent, thank you. Regards, Dan From djberg96 at gmail.com Fri Jan 28 16:55:08 2011 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 28 Jan 2011 14:55:08 -0700 Subject: [Win32utils-devel] kerberos on windows Message-ID: All, Somewhat OT here, but has anyone been able to build Kerberos 1.8.3 on Windows? There's an installer but it's old and it doesn't contain the admin headers or libraries. I tried to build with mingw + gcc, but it balked at the lack of libresolv. Attempts to build with VS were completely futile. Regards, Dan