[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How can I get the path of the my file (I need to write to a CVS file in my project folder) (How can I get the path of the my file (I need to write to a CVS file in my project folder) )
How can I get the path of the my file (I need to write to a CVS file in my project folder) [message #1829916] Mon, 13 July 2020 22:57 Go to next message
zakarias fridriksson is currently offline zakarias fridrikssonFriend
Messages: 2
Registered: July 2020
Junior Member
here below is my code, and I am always getting this path:

IWorkbenchPart workbenchPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); 
			IFile file = (IFile) workbenchPart.getSite().getPage().getActiveEditor().getEditorInput().getAdapter(IFile.class);
			String path = file.getRawLocation().toOSString();
			System.out.println("path: " + path);


/Users/zakariasfridriksson/runtime-EclipseApplication/is.ru.cs.PapyrusActivityLogger.example/is.ru.cs.PapyrusActivityLogger.example.di

everything is almost right, the runtime-EclipseApplication is wrong (should be: /Users/zakariasfridriksson/Desktop/HR/is.ru.cs.PapyrusActivityLogger.example/is.ru.cs.PapyrusActivityLogger.example.di
Re: How can I get the path of the my file (I need to write to a CVS file in my project folder) [message #1829920 is a reply to message #1829916] Tue, 14 July 2020 03:55 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

Check your runtime-EclipseApplication launcher settings, it sounds like its workspace location (which should NOT be the same as your original instance's) is not what you want it to be.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: How can I get the path of the my file (I need to write to a CVS file in my project folder) [message #1829958 is a reply to message #1829920] Tue, 14 July 2020 20:10 Go to previous message
zakarias fridriksson is currently offline zakarias fridrikssonFriend
Messages: 2
Registered: July 2020
Junior Member
yea it makes a fake workspace somewhere on my computer while I am working, but I need to access a file from the location of the code that I have written,.

Do you know how to do that? like what should I change in the configurations (if you understood me right the first time around)

thanks for your help in advance!
Previous Topic:Bundle activation visualization tool
Next Topic:How to listen to file events
Goto Forum:
  


Current Time: Thu Dec 12 16:56:14 GMT 2024

Powered by FUDForum. Page generated in 0.04043 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top