Creating a FSReference

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a FSReference

Sean P. DeNigris
Administrator
What's the easiest way to create a reference to, say, /dev from a string?

I came up with "FSFilesystem disk root resolveString: '/dev'." Anything better?

Also, what's the difference between
FSReference>>
  resolve:
  resolveString: ?

They both seem to do the same thing in this case.

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Creating a FSReference

Luc Fabresse
Hi Sean,

2011/11/1 Sean P. DeNigris <[hidden email]>
What's the easiest way to create a reference to, say, /dev from a string?

I came up with "FSFilesystem disk root resolveString: '/dev'." Anything
better?

I guess those ones also make it:

FSFilesystem disk root / 'dev'

(FSPath /  'dev') asReference

Cheers,

#Luc
 

Also, what's the difference between
FSReference>>
 resolve:
 resolveString: ?

They both seem to do the same thing in this case.

Thanks.
Sean

--
View this message in context: http://forum.world.st/Creating-a-FSReference-tp3962401p3962401.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Creating a FSReference

Sean P. DeNigris
Administrator
Luc Fabresse wrote
I guess those ones also make it:
FSFilesystem disk root / 'dev'
(FSPath /  'dev') asReference
Thanks, Luc. The reason I didn't use either of those is that I had an absolute path string, and using either with '/dev' instead of 'dev' produces '//dev' as a result.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Creating a FSReference

Sean P. DeNigris
Administrator
In reply to this post by Sean P. DeNigris
The more I play with FS, which is quite awesome, the more I'm wishing for an easier way to create an FSReference. I'm particularly confused by the resolve semantics. Consider the following attempts to create an FSReference from a path string:
* FSFilesystem disk root resolve: '/path/to/file.ext'. -> a valid FSReference
* FSFilesystem disk resolve: '/path/to/file.ext'. -> anFSAbsolutePath
* FSReference / 'path/to/file.ext' -> an invalid FSReference (self exists -> false)
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Creating a FSReference

Sean P. DeNigris
Administrator
Sean P. DeNigris wrote
I'm wishing for an easier way to create an FSReference
I created an issue to explore further http://code.google.com/p/pharo/issues/detail?id=5030&thanks=5030
Cheers,
Sean