Re: [NSFileHandle isOpen]?
Re: [NSFileHandle isOpen]?
- Subject: Re: [NSFileHandle isOpen]?
- From: Programmingkid <email@hidden>
- Date: Sat, 12 Feb 2011 11:17:32 -0500
On Feb 12, 2011, at 4:12 AM, Quincey Morris wrote:
> On Feb 11, 2011, at 22:23, Programmingkid wrote:
>
>> Is there a way to determine if a NSFileHandle object has been sent a closeFile message?
>
> This is probably the wrong list -- it's more of a Cocoa question than an Xcode question.
>
> It looks like there's no direct way to find out. I can think of two indirect ways which might work depending on what you're trying to do:
>
> 1. Subclass NSFileHandle and override 'closeFile'. That way you know for sure.
>
> 2. Something hacky like this:
>
> BOOL isClosed = NO;
> @try {
> [fileHandle fileDescription];
> }
> @catch (NSException*) exception {
> isClosed = YES;
> }
>
>
I actually have thought about doing it that way. I am sure there is a better way. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden