On 2/16/10 4:10 PM, Neil Allain wrote:
On Feb 16, 2010, at 2:57 PM, Laurent Daudelin wrote:
I'm working on a an app that at some point might start transferring a large
file to a USB device. Apparently, if the system is set to go to sleep, the
transfer will fail.
I was thinking of using the NSWorkspace extendPowerOffBy: but then the doc says
"Currently unimplemented".
So, if my app get a notification that the system is going to sleep, how can I
delay it?
You can call UpdateSystemActivity() periodically (such as on a timer) to
prevent it from going to sleep.
Neil
You should probably be using IOPMAssertionCreateWithName()
instead if you can require 10.5+. This gives the system a lot
more information about the intent of your code and the potential
ability to show some nice UI to the user.
-- Joe Ranieri
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/subscriber%40gloaming.com
This email sent to subscri...@gloaming.com
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com