Community
Participate
Working Groups
See bug #97783. This bug is opened to track long term fix/explanation.
We released a workaround for bug #97783 in 3.1 RC3. Need to track down when/why this happens and investigate a better fix. From Boris: My configuration: Windows XP, Service Pack 1 Internet Explorer 6.0.2800.1106.xpsp2.050301-1526 I have a file association, it says "Files with Extension 'LOG' are of type 'Text Document'". Opens with "Notepad".
My configuration: - Windows XP Professional Version 2002 Service Pack 1 (IBM Windows XP Version 1.0 Client for e-business) - Internet Explorer 6.0.2800.1106.xpsp2.050301-1526 When I first had the problem, I had a file association from *.LOG to Notepad. When I changed the association of *.LOG to Internet Explorer, I still had the problem, and had the same symptoms in Windows. If I double-clicked on .log, windows couldn't open it either. Once I removed the file association, everything was fine and in fact now I can't seem to make the problem happen again, even if I recreate the file association. See bug #97783 for original info.
Boris says (copied from #97783): An interesting observation: In Internet Explorer's history view, I can see entries for '.log' under "Today->My Computer". Clicking on the entry opens Notepad with the .log file. Apparently, Internet Explorer failed to open or display the file, but at least it put it in its history.
cc'ing those moving from bug #97783. Please post any interesting observations/platform info in here from now on.
Last copy from #97783. Boris says: I can reproduce the problem on my personal laptop, too. Windows XP, Service Pack 2 Internet Explorer 6.0.2900.2180.xps_sp2_gdr.050301-1519 I have a file association for .log, it looks just like the association on my workstation.
Boris - I would be curious if the problem disappears if you remove the file association from *.log and what happens when you restore the file association to *.log. In my case, removing the association "fixed" the problem and adding the association again never recreated it.
Here are my observations regarding file associations (Buttons mentioned are from the "Folder Options" dialog, tab "File Types"): Select "LOG", click "Change..." and select a different program (I have tried WordPad, Internet Explorer, Acrobat Reader, MS Paint): the problem is still there. Select "LOG" click on "Delete": the problem goes away. Click "New", enter "LOG", click "OK": the problem does not reappear. Select "LOG", click "Delete", click "New", enter "LOG", click "Advanced", select "Text Document" from the list. click "OK": the problem is back!
In the patch in bug 97783 that went into 3.1 RC3, it copies the log to a file in the workspace metadata area. Another option would be to use File.createTempFile. This has the advantage of not cluttering the metadata area, but has the downside of creating a new file each time.
Originally I was a bit nervous about temp files because I wanted exact control over the name of the file. However, we could consider a temp file with a controlled suffix (such as .txt), but we'd still be leaving multiple files laying around, and we'd have to check on any impacts of file associations for any suffix we choose. Hopefully, though, a longer term fix can detect the problem or otherwise avoid copying altogether.
I suggest we use the temp file approach with File.deleteOnExit(). Combine this with the likelyhood of someone doing this often and I think it is probably a reasonable approach.
Doug asks (in bug #97783) - Though I have a question: why does this open in a web browser and not a text editor?
This seems like a general issue. Although it's going through the browser APIs, the browser implementation just does a Runtime.execute on the path, which may result in some other kind of application than a web browser.
Nick, the 'system browser' is really a program registered to handle *.html files on your platform. We are using this because using SWT Program helps us reuse an opened browser and also allows us to respect user's defaults. If: 1) You map *.html to an application other than a browser or 2) You try to open a different content type using the browser API the results are unpredictable. If you want to make sure that browser is used all the time, you should select an explicit browser entry in the Web Browser preference page.
per comment #10 - if we do this later, check against JCL Foundation. See bug #80053 and bug #101350.
Also, to copy the file it should suffice to use FileInputStream/FileOutputStream rather than FileReader/FileWriter. There's no need to convert from bytes to chars when copying the file, and this can be slow.
changing prio and status to conform to plat-ui bug guidelines
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.