[Pharo-users] pathSegments of workingDirectory?

David Richards david.i.richards.iii at gmail.com
Thu Feb 14 10:27:55 EST 2019


Perfect.

Many thanks.

On Thu, 14 Feb 2019 at 05:14, Sven Van Caekenberghe <sven at stfx.eu> wrote:

>
>
> > On 14 Feb 2019, at 13:55, David Richards <david.i.richards.iii at gmail.com>
> wrote:
> >
> > Hi Sven,
> >
> > Your second example expression fails for 'workingDirectory':
> >
> > FileLocator workingDirectory resolve pathSegments
> > ==> #()
> >
> > It works fine for FileLocator home but not for FileLocator
> workingDirectory .
> >
> > Your first expression will produce the desired result, if ensourcelled
> with syntactimancy:
> >
> > FileLocator workingDirectory pathString asFileReference pathSegments
> >
> > This smells a lot like an edge case to me. But perhaps it is the Way of
> Smalltalk.
>
> Like Alistair said, it should be
>
>  FileLocator workingDirectory asAbsolute pathSegments.
>
> because it is a relative path.
>
> > Thanks
> > David
> >
> >
> >
> > On Wed, 13 Feb 2019 at 22:46, Sven Van Caekenberghe <sven at stfx.eu>
> wrote:
> > David,
> >
> > > On 14 Feb 2019, at 03:56, David Richards <
> david.i.richards.iii at gmail.com> wrote:
> > >
> > > Hi community,
> > >
> > > Consider:
> > >
> > > | file |
> > > file := FileLocator workingDirectory .
> > > file fullName .
> > > "==> '/Users/dr/Documents/Pharo/images/Study (Pharo 7.0 - 64bit
> stable)'"
> > > file pathSegments .
> > > "==> #()"
> > >
> > > How do we obtain path segments for the working directory?
> > >
> > > Is this an edge case where pathSegments does not return a semantically
> consistent value?
> > >
> > > Thanks
> > > David
> >
> > A FileLocator is a bit special, it is usable, but not yet fully
> realised, more abstract.
> >
> > You can use resolve. Consider:
> >
> > FileLocator home pathString.
> >  "'/Users/sven'"
> >
> > FileLocator home resolve pathSegments.
> >  "#('Users' 'sven')"
> >
> > HTH,
> >
> > Sven
> >
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190214/6940b659/attachment.html>


More information about the Pharo-users mailing list