Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Anders Norlander
If it is a read call that is interrupted, you might get around the problem by making the signal restartable (SIGCHLD probably). Assuming availableData doesn't mess around with the signals (which it shouldn't). If the implementation of availableData is using select, or one of its brethren, the sy

Re: Is a file open in another application?

2011-03-19 Thread Brad Stone
I do need it to work for any app, not just Word or XL. I guess a poor workaround would be since it's not possible to reliably check if the file is open I can force the user to quit the file's default app before allowing them to encrypt. It's just kind of heavy-handed. On Mar 19, 2011, at 6:20

Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Jason Harris
Answer part III On Mar 19, 2011, at 8:43 PM, Bill Monk wrote: > * Except, when it finally does call finishUp (if it ever does; here it seems > to get into an infinite loop), it's just too complicated. All you do here is > unregister observers, read any remaining data, and dispose of file handle

Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Jason Harris
Answer part II On Mar 19, 2011, at 8:43 PM, Bill Monk wrote: > Please, you must stop now, you're going to make yourself nuts. :) > > - (void) gotError:(NSNotification*)notification > { > > (@"...got NULL Error Output for %@ ...", [self commandLineString]); > errHandle_ = nil; >

Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Jason Harris
Sorry I have to break this into several replies to get around the automatic size limits of post to this group. So here is the reply in a couple of bites: On Mar 19, 2011, at 8:43 PM, Bill Monk wrote: >> I have looked at (in fact studied in detail) the source code for Moriarity, >> AMShellWrappe

Re: iPhone animation puzzle

2011-03-19 Thread Roland King
UIViewAnimationOptionAllowUserInteraction ? On Mar 20, 2011, at 5:42, David Rowland wrote: > This works. It fades the label to invisibility. > > label.alpha = 1.0; > [UIView beginAnimations:nil context:nil]; > [UIView setAnimationDuration:2.5]; > label.alpha = 0; > [UIView commitAnimatio

TableView / ArrayController sorting not updating the tableview

2011-03-19 Thread Darren Wheatley
Hi, I have an NSTableView bound to a core-data-backed NSArrayController by binding individual columns to arraycontroller.arrangedObjects. I have the default out-of-the-box sorting working, but when I click one of the column headers to sort the table I have problems. Basically the display of the

Re: Visual feedback of invalid cell data from Core Data - how to?

2011-03-19 Thread Jerry Krinock
On 2011 Mar 19, at 14:55, Quincey Morris wrote: > Note that Core Data doesn't give a damn if you pollute your data model with > invalid attribute values, even violations of entity-declared constraints, > until it gets to a save. At that point it will refuse to save if there are > any errors it

Re: Is a file open in another application?

2011-03-19 Thread Charles Srstka
On Mar 19, 2011, at 1:40 PM, Conrad Shultz wrote: > On 3/19/11 11:10 AM, Kyle Sluder wrote: >> On Sat, Mar 19, 2011 at 9:13 AM, Conrad Shultz >> wrote: >>> Note that this will only capture files that are properly opened (i.e. >>> fopen()'d), so you won't catch every apparently open file. For exa

Re: Icon not bouncing in Dock when App started

2011-03-19 Thread Markus Spoettl
On Mar 19, 2011, at 7:46 PM, Nick Zitzmann wrote: >> Is that a hardware issue then? Can someone recreate this on their hardware? > > No, it's a software thing. If you turn on CoreAnimation on one of the > dual-GPU Macs, and graphics switching is turned on, and the Mac isn't plugged > into a moni

Re: Visual feedback of invalid cell data from Core Data - how to?

2011-03-19 Thread Quincey Morris
On Mar 19, 2011, at 13:44, Luke Evans wrote: > I definitely want the regular Core Data validation process to propagate and > drive this, rather than having to set formatters on all my cell (or > something) and manually figure out validation by some means. I think your want might be internally sel

iPhone animation puzzle

2011-03-19 Thread David Rowland
This works. It fades the label to invisibility. label.alpha = 1.0; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2.5]; label.alpha = 0; [UIView commitAnimations]; and so does this, label.alpha = 1.0; [UIView animateWithDuration:2.5 animations:^{label.alpha

Re: Is a file open in another application?

2011-03-19 Thread Dave Keck
> Is there a way for me to tell if a particular file is open in another > application? The following thread offers one solution: http://www.cocoabuilder.com/archive/cocoa/288040-notification-of-file-system-modification-arrives-too-early.html which might be worth using if proc_listpidspath(

Visual feedback of invalid cell data from Core Data - how to?

2011-03-19 Thread Luke Evans
I'm curious as to the best (or a) way to achieve the following: - I have a Core Data model set up with validation of various kinds (non-optional values, ranges, regexs etc.) on attributes. - I have a table based UI showing these entities for viewing and editing. I would like to make the backgroun

Re: Is a file open in another application?

2011-03-19 Thread Scott Ribe
On Mar 19, 2011, at 1:58 PM, Frédéric Testuz wrote: > I can't think of a general solution, but IIRC Brad is only interested about > Word and Excel. These applications have AppleScript support. > > I'm sure he can ask Word by AppleScript for the open documents. He had to > check if Word can also

Re: Is a file open in another application?

2011-03-19 Thread Frédéric Testuz
Le 19 mars 2011 à 20:03, Kyle Sluder a écrit : > On Sat, Mar 19, 2011 at 11:40 AM, Conrad Shultz > wrote: >> Are you certain that is a general behavior? > > 1. Open TextEdit. > 2. Type some stuff. > 3. Save As > /tmp/somefile.rtf > 4. `lsof |grep somefile` prints nothing. > >> For example, I ha

Re: Is a file open in another application?

2011-03-19 Thread Scott Ribe
On Mar 19, 2011, at 12:40 PM, Conrad Shultz wrote: > For example, I have Preview open right now, and it very much lists all > its open files: And I have Preview open right now, and it does not have any of its files open. This is on 10.6.6, Preview 5.0.3. Further, I can tell you that some older

Re: Is a file open in another application?

2011-03-19 Thread jonat...@mugginsoft.com
On 19 Mar 2011, at 13:34, Brad Stone wrote: > Is there a way for me to tell if a particular file is open in another > application? > > I have a feature I'd like to provide to my users that involves encrypting > files that belong to other apps (i.e. my application can encrypt/decrypt a > Word

Re: Is a file open in another application?

2011-03-19 Thread Kyle Sluder
On Sat, Mar 19, 2011 at 11:40 AM, Conrad Shultz wrote: > Are you certain that is a general behavior? 1. Open TextEdit. 2. Type some stuff. 3. Save As > /tmp/somefile.rtf 4. `lsof |grep somefile` prints nothing. > For example, I have Preview open right now, and it very much lists all > its open f

Re: Icon not bouncing in Dock when App started

2011-03-19 Thread Nick Zitzmann
On Mar 19, 2011, at 5:41 AM, Markus Spoettl wrote: > On Mar 19, 2011, at 11:29 AM, Markus Spoettl wrote: >> In my document based application, when started (by clicking on the dock icon >> or otherwise), the icon's startup bounce motion interrupts near the top of >> the animation, stays there fo

Re: Is a file open in another application?

2011-03-19 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/19/11 11:10 AM, Kyle Sluder wrote: > On Sat, Mar 19, 2011 at 9:13 AM, Conrad Shultz > wrote: >> Note that this will only capture files that are properly opened (i.e. >> fopen()'d), so you won't catch every apparently open file. For example, >> i

Re: Is a file open in another application?

2011-03-19 Thread Kyle Sluder
On Sat, Mar 19, 2011 at 9:13 AM, Conrad Shultz wrote: > Note that this will only capture files that are properly opened (i.e. > fopen()'d), so you won't catch every apparently open file.  For example, > if you open a file in vi(m), it creates a hidden scratch file in the > same directory and close

Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Jason Harris
On Mar 19, 2011, at 1:27 PM, Ken Thomases wrote: > On Mar 18, 2011, at 5:32 PM, Jason Harris wrote: > >> On Mar 18, 2011, at 11:07 PM, Ken Thomases wrote: >> >>> The exception is saying that the file descriptor backing the >>> NSPipe/NSFileHandle has been closed. Retrying after some time can

Re: Is a file open in another application?

2011-03-19 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 (Copying the list this time...) On 3/19/11 6:34 AM, Brad Stone wrote: > Is there a way for me to tell if a particular file is open in another > application? > > I have a feature I'd like to provide to my users that involves > encrypting files that be

Is a file open in another application?

2011-03-19 Thread Brad Stone
Is there a way for me to tell if a particular file is open in another application? I have a feature I'd like to provide to my users that involves encrypting files that belong to other apps (i.e. my application can encrypt/decrypt a Word or Excel file). I want to prevent the user from encryptin

Re: NSMatrix bindings

2011-03-19 Thread Christian Ziegler
On Mar 18, 2011, at 10:14 PM, Ken Thomases wrote: > On Mar 18, 2011, at 3:45 AM, Christian Ziegler wrote: > >> I'm having hard times figuring out how to bind an NSMatrix properly. I got >> an NSMatrix with NSButtonCells (checkboxes) and I want to somehow bind to my >> model which of these chec

Re: NSTask is intermittently failing to return results.

2011-03-19 Thread Ken Thomases
On Mar 18, 2011, at 5:32 PM, Jason Harris wrote: > On Mar 18, 2011, at 11:07 PM, Ken Thomases wrote: > >> The exception is saying that the file descriptor backing the >> NSPipe/NSFileHandle has been closed. Retrying after some time can only >> result in the frameworks co-opting a new, unrelate

Re: Icon not bouncing in Dock when App started

2011-03-19 Thread Markus Spoettl
On Mar 19, 2011, at 11:29 AM, Markus Spoettl wrote: > In my document based application, when started (by clicking on the dock icon > or otherwise), the icon's startup bounce motion interrupts near the top of > the animation, stays there for around 0.3 - 0.5 seconds and then the icon > drops to t

Icon not bouncing in Dock when App started

2011-03-19 Thread Markus Spoettl
Hi, I have a strange problem, and I have no idea what causes it: In my document based application, when started (by clicking on the dock icon or otherwise), the icon's startup bounce motion interrupts near the top of the animation, stays there for around 0.3 - 0.5 seconds and then the icon d