[Top][All Lists]

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

Re: NSSavePanel complains about .hidden

From: Nicola Pero
Subject: Re: NSSavePanel complains about .hidden
Date: Sun, 6 Oct 2002 07:26:17 +0100 (BST)

> >>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.

I'm not sure ... I just think they should be NSDebugLogs and not
NSWarnLogs, since they are not warning about possible programming errors
in the user code, but rather providing information which might be
potentially useful for 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).

I don't understand why you are assuming that +stringWithContentsOfFile
returning nil is an error.  The caller will assess that.  In the case of
NSSavePanel, for example, it's a perfectly valid condition.

This is why the warning should be a NSDebugLog - off by default (as it is
an undocumented and possibly unwanted warning about a 'maybe error', not
an actual official error), and should only be turned on if you require it
by using the appropriate --GNU-Debug stuff.

reply via email to

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