[Win32utils-devel] Implementing a TaskScheduler#exists? method

Heesob Park phasis at gmail.com
Thu Jun 18 20:36:36 EDT 2009


Hi,

2009/6/19 Daniel Berger <djberg96 at gmail.com>:
>
>
>> -----Original Message-----
>> From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel-
>> bounces at rubyforge.org] On Behalf Of Heesob Park
>> Sent: Wednesday, June 17, 2009 7:23 PM
>> To: Development and ideas for win32utils projects
>> Subject: Re: [Win32utils-devel] Implementing a TaskScheduler#exists?
>> method
>>
>> Hi,
>>
>> 2009/6/17 Daniel Berger <djberg96 at gmail.com>:
>> >
>> >
>> <snip>
>> > I thought it would be problematic because it's C++, but if you can do
>> it, by all means please go for it!
>> >
>> Here is a pure ruby win32-taskscheduler.
>> http://121.78.227.9/win32-taskscheduler/taskscheduler.rb
>
> Looks like there's a bug in line 756 (in the file in CVS) in the
> new_work_item method:
>
> memcpy(lpVtbl, @pITask, 4)
>
> That's segfaulting.
>
> Here's a small sample to demonstrate:
>
>   trigger = {
>      'start_year'   => 2011,
>      'start_month'  => 4,
>      'start_day'    => 11,
>      'start_hour'   => 7,
>      'start_minute' => 14,
>      'trigger_type' => TaskScheduler::DAILY,
>      'type'         => { 'days_interval' => 1 }
>   }
>
>   ts = Win32::TaskScheduler.new('foo', trigger)
>   ts.save
>   ts.activate('foo')
>
> Hopefully I didn't accidentally introduce it.
>
I works fine with my XP box.
What's your OS and Ruby version?

Regards,
Park Heesob


More information about the win32utils-devel mailing list