Re: Notification when network volume disappears

2010-06-15 Thread vincent habchi
Le 14 juin 2010 à 20:37, Jens Alfke a écrit : Last I heard (admittedly, a few years ago) there wasn’t any good way to do async/nonblocking filesystem operations. The standard system calls block; the O_NONBLOCK mode for fcntl only works on network socket streams; and the AIO API has (had?)

Notification when network volume disappears

2010-06-14 Thread Boris Prohaska
Hi guys, i was just wondering, is there any way to determine when for example a network cable is plugged off while copying data to a network share? The Finder has a pretty long timeout... Is there a way in the FS API or ANY other way to get notified, when a volume isn't available for writing

Re: Notification when network volume disappears

2010-06-14 Thread Ken Thomases
On Jun 14, 2010, at 4:52 AM, Boris Prohaska wrote: i was just wondering, is there any way to determine when for example a network cable is plugged off while copying data to a network share? The Finder has a pretty long timeout... Is there a way in the FS API or ANY other way to get

Re: Notification when network volume disappears

2010-06-14 Thread Boris Prohaska
Thats exactly the problem. IF the OS was aware of it, then there would be no problem. There is also no setting for timeouts etc when performing blocking operations onto the filesystem. Maybe that is a OS X limitation?? Boris On 14.06.2010, at 17:04, Ken Thomases wrote: On Jun 14, 2010, at

Re: Notification when network volume disappears

2010-06-14 Thread Ken Thomases
On Jun 14, 2010, at 11:40 AM, Boris Prohaska wrote: Thats exactly the problem. IF the OS was aware of it, then there would be no problem. There is also no setting for timeouts etc when performing blocking operations onto the filesystem. Maybe that is a OS X limitation?? The way around it

Re: Notification when network volume disappears

2010-06-14 Thread Jens Alfke
On Jun 14, 2010, at 11:13 AM, Ken Thomases wrote: The way around it is to not do blocking operations. Use non-blocking, asynchronous I/O operations, and impose the timeout yourself. Last I heard (admittedly, a few years ago) there wasn’t any good way to do async/nonblocking filesystem

Re: Notification when network volume disappears

2010-06-14 Thread mm w
I don't know which kind of connection you want to observe, but basically SCNetwork and SCNetworkReachability are your friends. then control these (and get the right conf) using two callback handlers use NSWorkspace to get your entry and your exit (if this case happens)

Re: Notification when network volume disappears

2010-06-14 Thread mm w
no you are in the weed there On Mon, Jun 14, 2010 at 9:40 AM, Boris Prohaska borisproha...@gmx.at wrote: Thats exactly the problem. IF the OS was aware of it, then there would be no problem. There is also no setting for timeouts etc when performing blocking operations onto the filesystem.

Re: Notification when network volume disappears

2010-06-14 Thread Ken Thomases
On Jun 14, 2010, at 1:37 PM, Jens Alfke wrote: On Jun 14, 2010, at 11:13 AM, Ken Thomases wrote: The way around it is to not do blocking operations. Use non-blocking, asynchronous I/O operations, and impose the timeout yourself. Last I heard (admittedly, a few years ago) there wasn’t