Category Archives: Snippet

Create a Process and Read Its Output

This is a snippet of windows C++ code to create a process and read its output until some specific string is printed. This is useful for programmer to start a server and only to return until the server is started, … Continue reading

Posted in C++, Snippet, Tricks | Leave a comment

Snippet: Open Editor a Local File in Eclipse

Here is codes to open editor a local file in Eclipse: IFileStore fileStore = EFS.getLocalFileSystem() .getStore(new Path(file.getParent())); fileStore= fileStore.getChild(file.getName()); if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) { IWorkbenchWindow fWindow = Java2ScriptUIPlugin.getDefault() .getWorkbench().getActiveWorkbenchWindow(); IWorkbenchPage page = fWindow.getActivePage(); try { IDE.openEditorOnFileStore(page, fileStore); } catch (PartInitException … Continue reading

Posted in Eclipse, Snippet | Leave a comment