[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSavePanel complains about .hidden

From: Adam Fedor
Subject: Re: NSSavePanel complains about .hidden
Date: Sat, 05 Oct 2002 19:59:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020610

Nicola Pero wrote:
Richard latest changes to NSData caused that the NSSavePanel now complains, if it cannot find a .hidden file in a directory:

2002-10-05 13:21:29.687 Ink[1323] File NSData.m: 219. In readContentsOfFile Open (/.hidden) attempt failed - No such file or directory

I'm not sure if it is a good policy that the base library jumps to talk
directly to the user (/stderr) ... because it's a very inflexible /
uncustomizable behaviour - the library should instead allow the program to
perform/provide its own checks / error routines, which might depend a lot
on the situation - a NSLog might be totally inappropriate.

When run in a graphical environment, a User wouldn't even typically see these message, since they would go to the console. NSLog messages are more for developers and bug tracking.

NSString +stringWithContentsOfFile should return nil if the file can't be
opened ... it is up to the caller to decide what to do in that case, if
this is perfectly acceptable or it is a major error, if it needs to be
logged to stdout / stderr / a file / displayed in an alert panel /
whatever, or if it can be ignored (as in the case of NSSavePanel).

Well, it would be nice if the reason for the error could be stored somewhere (like Unix's errno/errstring). That was the reason that this change was made in the first place - the libraries spit out an error that was completely different than the real reason it failed. It's typically the higher level methods that need to decide if something is an error anyway.

Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                      | know how I hate the stuff.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]