I ran into the following bug. If you evaluate the following code:
| dir file | dir := ServerDirectory new fullPath: (FileDirectory default url). file := dir asServerFileNamed: 'test.txt'. Transcript show: (file fileNameRelativeTo: dir); cr.
You'd expect to get on Win32: D:\Users\angela\Squeak\test.txt and on MacOS: Mars:Users:angela:Squeak:test.txt
But in both cases there is an additional leading '/'. The code that causes this is in class FileUrl, method #pathForDirectory:
^ String streamContents: [ :s | isAbsolute ifTrue: [ s nextPut: $/ ]. 1 to: self path size - 1 do: [ :ii | s nextPutAll: (path at: ii); nextPut: FileDirectory default pathNameDelimiter ] ]
If the FileUrl object is absolute then a '/' is prepended, independent of the computer platform. I'd the slash should only be prepended on platforms that start an absolute path with a slash. I don't know how to perform platform tests in Squeak, so I can't propose a solution. Anyone?
Rudi Angela
__________________________________________________________________ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
squeak-dev@lists.squeakfoundation.org