Re: Watching a file for changes.

2013-03-22 Thread Jens Alfke
On Mar 20, 2013, at 10:15 AM, Christ Levesque wrote: > If you mean in a text edit is it so easy you can use observing mechanism on > object that has changed. For instance you have a text edit app and you assume > input to this app an NSString. Well you make a new class inherited from > NSStri

Re: Watching a file for changes.

2013-03-21 Thread Christ Levesque
If you mean in a text edit is it so easy you can use observing mechanism on object that has changed. For instance you have a text edit app and you assume input to this app an NSString. Well you make a new class inherited from NSString and when this class's ivars changed you use addObserver:forK

Re: Watching a file for changes.

2013-03-20 Thread Scott Ribe
On Mar 20, 2013, at 10:37 AM, Jay Freeman wrote: > At a lower level, there is always the C library function, "stat". Do "man > stat" for details. But you have to poll, which sucks. kqueue lets you block for an event. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303)

Re: Watching a file for changes.

2013-03-20 Thread Jay Freeman
At a lower level, there is always the C library function, "stat". Do "man stat" for details. -- Jay Reynolds Freeman - jay_reynolds_free...@mac.com http://JayReynoldsFreeman.com (personal web site) ___ Cocoa-dev mailing list (C

Re: Watching a file for changes.

2013-03-20 Thread Mr. Gecko
Thanks, I'll read though how that works and see if I can implement it in my software. On Mar 20, 2013, at 11:26 AM, Scott Ribe wrote: > On Mar 20, 2013, at 9:34 AM, Felix Franz wrote: > >> You can use kqueue or some wrapper like UKKQueue >> (http://zathras.de/angelweb/sourcecode.htm) >> or VD

Re: Watching a file for changes.

2013-03-20 Thread Scott Ribe
On Mar 20, 2013, at 9:34 AM, Felix Franz wrote: > You can use kqueue or some wrapper like UKKQueue > (http://zathras.de/angelweb/sourcecode.htm) > or VDKQueue (https://github.com/bdkjones/vdkqueue). I think kqueue is > available in 10.4, but > better check for yourself. kqueue was introduced i

Re: Watching a file for changes.

2013-03-20 Thread Felix Franz
On 20.03.2013, at 16:23, Mr. Gecko wrote: > How can I watch for file changes? E.G. I open a file in Text Edit, I change > the file by adding a few words, I save the file. After the file is saved, > I'll like to know it was saved. > > I need to know how to do this both in 10.8 and 10.4. E.G. F

Watching a file for changes.

2013-03-20 Thread Mr. Gecko
How can I watch for file changes? E.G. I open a file in Text Edit, I change the file by adding a few words, I save the file. After the file is saved, I'll like to know it was saved. I need to know how to do this both in 10.8 and 10.4. E.G. For directories in 10.8, I use FSEventStreamCreate. For