Community
Participate
Working Groups
Steps: 1) Create a file a.txt 2) Preferences->Workbench->File Editors->Select *.txt 3) Add extenal editor -> "wordpad document" 4) close a.txt if opened. 5) Select a.txt 6) File->Open with-> WordPad A dialog will be open with a CoreException. See ExternalEditor>>#open() throws CoreException NOTES: EJP (9/21/2001 1:38:00 PM) The problem in the Program.execute On NT the instance var command = full path name of the executable. On 2000 command = %SystemRoot%\system32\NOTEPAD.EXE EJP (9/21/2001 1:49:26 PM) When using Wordpad the var is %Program files%
PRODUCT VERSION: Eclipse Build 136 - Win2000
Could we increase the priority of this bug. Some times it is usefull to launch external programs? It would be interesting to fix bug 4835 as well since it is related.
FH to investigate. Talk to SSQ about it.
Small code that shows the bug =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- import java.io.File; import org.eclipse.swt.program.Program; public class TestProgram { public static void main(String[] args){ Program[] programs = Program.getPrograms(); Program program = null; for (int i = 0; i < programs.length; i++) { Program p = programs[i]; if( p.getName().equals("WordPad Document") ) { program = p; break; } } if (program == null) { System.out.println("Program not found"); return; } String filename = "D:\\eclipse\\runtime-workspace\\Test\\a.txt"; File f = new File (filename); if( f.exists() ) //just to be sure... System.out.println("Sucess: "+program.execute(filename)); } } =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Exception hide inside the Program.execute: java.io.IOException: CreateProcess: "%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE" "D:\eclipse\runtime-workspace\Test\a.txt" error=2
Fixed > 20020424