Location of linked resource [message #326709] |
Sun, 30 March 2008 09:30  |
Eclipse User |
|
|
|
Hi,
When I run this code:
[snip]
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
IProject project = wsRoot.getProject( "p" );
project.create( null );
project.open( null );
IFolder folder = project.getFolder( "f" );
folder.createLink( new Path( "/tmp/f/" ), IResource.ALLOW_MISSING_LOCAL,
null );
System.out.println( folder.getLocation() );
System.out.println( folder.getRawLocation() );
System.out.println( folder.getLocationURI() );
[snap]
I'm getting:
[snip]
/private/tmp/f
/private/tmp/f
file:/private/tmp/f
[snap]
Which is a bit surprising: where does the 'private' come from? Am I
missing something? How can I get to the correct local path of the linked
folder?
I'm on Mac (OS X 10.5.2) using Eclipse 3.3.2.
Thanks for any help && ciao,
Leif
|
|
|
|
|
Re: Location of linked resource [message #326757 is a reply to message #326744] |
Mon, 31 March 2008 14:27  |
Eclipse User |
|
|
|
Hi again,
I did some research and it seems /tmp/ on Macs generally is symlinked to
/private/tmp/, along with other standard unix folders. So Eclipse must
resolve the symlink at some point, and when getting the location we end up
with the resolved path. (I can live with that for my immediate purpose,
although I'm somewhat unhappy with an asymmetric behaviour like this -
setting some path and then directly asking for it should return the same
path again, I would expect.)
Sorry for the noise,
Thanks && ciao,
Leif
|
|
|
Powered by
FUDForum. Page generated in 0.03612 seconds