From: Phillip Gawlowski Date: 2009-12-19T05:16:57+09:00 Subject: Re: Computer States On 18.12.2009 21:00, Brandon B. wrote: > yea, i expected as much, which if fine, i just dont know how to go about > doing so... maybe there is a way to send a "wake-up" packet to the ram, > or nvram, and have it execute it from there at a given time? dont know > too much about what can and cant be performed like that so, if im way > off base, please forgive me. You'd've to read the ACPI spec, I'm afraid, what does what, if you want to go really, really low level, since I stay away from the Dark Arts. ;) > like i said, this is for linux, obviously, which if it works takes out > one of my issues, but what i dont know is if there is anything like the > above file locations for windows or mac? With Windows, there's the win32api gem (pre-installed in the Once Click Installer and/or the new RubyInstaller), providing access to the Windows API, so you can call the Windows system calls to send the computer to sleep. Or, maybe, you can shell out to "shutdown", but I'm not well versed in Windows CLI tools, at least to send to computer to sleep. I'm pretty sure that WakeOn needs an API call, though. With Macs, and this is from my dim memory, there's CocoaRuby (I think that's what it is called, googling for "cocoa ruby" should unearth something), which accomplishes roughly the same as the win32api gem. Keep in mind, you can run into binary compatibility issues on Windows (depending on the Ruby variant installed, there's mswin32, and mingw32, the latter being included in the new RubyInstaller), as well as on Mac (depending on the Mac Os X API changes). And that ain't even touching on JRuby. So, "true" cross-platform compatibility will be difficult, to say the least. Mind, just pick the Ruby versions you are able to report, and you'll be fine, don't let me scare you. :) -- Phillip Gawlowski