Judson Valeski wrote:
>
> Next Tuesday we'll be having an API review meeting to get our nsIFile
> iface back up to speed before we (Pete Collins, _the man_, has stepped
> up) bang out the clean-up. See
> http://www.mozilla.org/projects/embedding/apiReviewNotes.html#nsIFile
> for the most recent notes on the topic.
>
> I wanted to spark this thread now, as we may not have access to Doug
> Turner's brain next week for the meeting, and he's got some opinions.
>
> Specifically, there's grumbling that the notes above are dated WRT the
> following line items:
>
> - ditch the char * method versions in favor of Unicode versions
> - spawn should go away
>
> We're all friends here, eveyrone be gentle w/ one another :-).
>
> Jud
I probably don't know what I'm talking about so feel free to ignore this
but it seems to me that mozilla takes a rather restricted view of a
file. Mozilla is supposed to be a multi-platform product so I would
think that its concept of a file would be a superset of all the file
types on all the platforms on which it runs. What you seem to have is a
view from one particular platform. Would it not be better to treat all
files as (potentially) having all possible properties? Many properties
would be null but there would be far fewer special cases.
Another thing is that it is assumed that users of nsIFile know about all
possible file types and know what to do for each type. That seems risky
in theory and appears to be untrue in practice. Why not have different
"contexts" with specific properties and methods. At the least there are
two contexts, a "use context" where you operate on a file, e.g.
creating, deleting, reading, writing, and a "list context" used
(obviously) for listings and displays for the end user. The "list
context" could well have different properties and methods for any given
physical file than the "use context." If it were me, I would force users
to specify the context for any operation to keep them focused on what
they are trying to do.
Why all this complexity? Symlinks, mostly. There is a clear difference
between looking at a ls -l style listing and actually using a symlink.
Human user make the distinction, mozilla should as well.
--
Sun
2001-08-05 16:04:17.634 UTC (JD 2452127.169649)
X = -0.002819630, Y = -0.005093279, Z = -0.002084900 (au)
X' = 0.000008603, Y' = -0.000001307, Z' = -0.000000793 (au/d)