[Pharo-dev] Path * '' vs. Path workingDirectory
guillermopolito at gmail.com
Mon Aug 14 07:44:41 EDT 2017
On Sun, Aug 13, 2017 at 5:54 PM, Alistair Grant <akgrant0710 at gmail.com>
> Hi All,
> Is there any practical difference between (Path * '') and (Path
Being strict, Path workingDirectory does not make any sense. A path is
relative or absolute. And it is relative to some other path.
I'd expect that Path workingDirectory gives you an absolute path to the
current working directory,,,
> Their internal representation is different:
> - (Path * '') has one empty segment
> - Path workingDirectory has no segments
> But as far as I can tell they are otherwise the same:
> | fs frEmpty frWD |
> fs := FileSystem disk.
> frEmpty := FileReference fileSystem: fs path: (Path * '').
> frWD := FileReference fileSystem: fs path: Path workingDirectory.
> String streamContents: [ :stream |
> << 'frEmpty: ';
> << frEmpty printString; cr;
> << 'frWD: ';
> << frWD printString; cr;
> << '= : ';
> << (frEmpty absolutePath = frWD absolutePath) printString; cr.
> 'frEmpty: "File @ "
> frWD: "File @ ."
> = : true
French National Center for Scientific Research - *http://www.cnrs.fr*
*Web:* *http://guillep.github.io* <http://guillep.github.io>
*Phone: *+33 06 52 70 66 13
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev