Creating a FSReference

classic Classic list List threaded Threaded
5 messages Options
Sean P. DeNigris Sean P. DeNigris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Creating a FSReference

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
Luc Fabresse Luc Fabresse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Creating a FSReference

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.


Sean P. DeNigris Sean P. DeNigris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Creating a FSReference

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
Sean P. DeNigris Sean P. DeNigris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Creating a FSReference

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)
Sean P. DeNigris Sean P. DeNigris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Creating a FSReference

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
Loading...