
On Wed, Jul 26, 2006 at 11:39:40AM -0700, Andrew Pimlott wrote:
On Wed, Jul 26, 2006 at 03:29:01PM +0200, Udo Stenzel wrote:
Andrew Pimlott wrote:
Also, it looks from this that you treat paths differently depending on whether they end in a separator. Yet this makes no difference to the system. That seems wrong to me.
Not to the system, but some programs like to make a difference.
How does it make a difference? Do you have an answer that applies uniformly to all programs? If not, aren't we just walking down a blind alley? I've heard that Emacs treats double-separators specially. Do we account for that too?
cp(1), for example, treats paths with trailing separators differently from paths without. rm -rf foo bar echo test > foo echo othertest > bar cp foo bar/ cp foo bar It's part of the user interface, that allows the user to specify that he or she intends to use a path to describe a directory. This doesn't apply uniformly to all programs--except that we can say that any path with a trailing '/' is intended to be a directory, and if it's not, then that's an error. But the trouble is that if you silently drop the '/', then the only way for me to implement a correct cp(1) in Haskell is to not use your proposed interface for pathname handling, which drops this information. I'd also point out that rieser4, for instance, treats paths with a trailing slash differently even for files. True, it's probably not a good idea, but if we're talking about a portable library we might want it to work even on systems running an "interesting" filesystem like rieser4. -- David Roundy