* Method semantics.

I beleive the main reason symlinks are in such bad shape on unix is 
partly due to semantics.

For example

See Bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=92329

1. GetTarget is currently implemented w/ a simple wrapper around the 
libc call readlink. The problem is that callers accessing this method 
think GetTarget will due just that, return the target filepath. The 
problem w/ readlink is that a relative symlink will return a relative 
path. This breaks the filepicker. So there is a suggestion to perhaps 
have a readlink method in addition to GetTarget.

GetTarget to me and (i beleive most callers) suggests resolvet the 
ultimate target of the symlink chain.

2. I think ridding AppendRelativePath is a good idea and will solve a 
lot of problems. However, GetLeafName and Append need to support '../' 
paths on unix.

Example: '/usr/local/www/../../../etc/passwd'

Is a perfectly valid unix file path.

See bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=55406

I fixed this already for appendrelativepath so it's not a big deal.
The question again is the semantics of what is a valid filepath to mozilla.

* Additional Methods

Get/SetOwner
Get/SetGroup

There is an implementation of this here:
See Bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=70723


* Performance
nsIFile needs to be a quick and efficient as possible. This should be a 
major priority for all platforms.

Will unicode string conversion significantly impede performance and 
waste memory?


* Regression
changing attributes like GetParent, GetDirectoryEntries to methods will 
break a lot of existing code. Something to think about.

We should cut a branch to do this work on.

--pete




Reply via email to