> On 14 Dec 2016, at 10:13, Peter Uhnak <[email protected]> wrote: > > Hi, > > is there a reason why FileLocator behaves like this? > > FileLocator home -> FileLocator({home}) > FileLocator D -> FileReference(D:\) > > Especially the first one (this also applies to #temp and others), > is there a benefit in returning FileLocator instead of the path? Because now > I always end up doing > FileLocator home asFileReference, which feels superfluous. > > What is the use case that you don't want to resolve it yet?
I think the idea is that the first one is like $HOME, i.e. it can be different on different machines/contexts. It is a higher level abstraction that can resolve to different concrete directories. To work with these more abstract file references you just use them. (FileLocator temp / 'foo.txt') ensureCreateFile. (FileLocator temp / 'foo.txt') fullPath. Conversions happen when needed. At least, this is how I think FileSystem was designed. > Thanks, > Peter > >
