Getting Linux path on Windows [message #673598] |
Tue, 24 May 2011 08:29 |
MaximeLecourt Messages: 108 Registered: February 2010 Location: France |
Senior Member |
|
|
Hi,
I'm having trouble with paths under WindowsXP.
public IFile getFile(String path) {
IPath ipath = new Path(path);
IFile res = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(ipath);
if(res == null)
res = ResourcesPlugin.getWorkspace().getRoot().getFile(ipath);
return res;
}
I call that function with a windows path String.
The IPath is ok, device and path are still good.
But once I try to turn it to IFile, res looses the device, and returns a Linux path (so instead of D:\the\way\to\my.file, I get /the/way/to/my.file).
Any subsequent use of the resulting IFile fails, of course, as it searches a file with a Linux path on a Windows system.
Is that a bug or am I doing some things wrong ?
Thanks
Maxime
One day I shall master M2T, but that day has yet to come...
|
|
|
|
Powered by
FUDForum. Page generated in 0.02540 seconds