Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 77919

Summary: [IDE] auto reload a file changed externally
Product: [Eclipse Project] Platform Reporter: Jing Xue <jxue01>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 CC: ed.burnette, mike
Version: 3.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jing Xue CLA 2004-11-04 21:53:20 EST
Now if a file is changed by an external program, Eclipse pops up a dialog asking
if the user would like to refresh.  It would be nice to make it configurable so
that a user can choose to just automatically refresh the file.  This would be
very useful when viewing logs in real-time.
Comment 1 Michael Van Meekeren CLA 2004-11-08 13:27:21 EST
I assume you mean that you have the file open in an editor.  I see how since you
are using an editor to view a file this would be nice.  But the reality is that
an editors purpose is generally to edit the file.

I can imagine that in the case where no changes were made inside eclipse that we
could offer to remember your decision not to prompt about file changes for
non-dirty editors or something.

Another question is "Should there be some other view on your file such as a
console or error log etc...?"
Comment 2 Jing Xue CLA 2004-11-08 22:10:36 EST
Hmm I would contend that people do use editors to _view_ files.  I realize from
time to time one might _not_ like to automatically refresh a file changed
externally, that's why I'm suggesting to make it an option (as you implied as well).
Comment 3 Ed Burnette CLA 2006-02-15 08:37:03 EST
I'd like to lobby for this, and not just for the IDE even though the entry is currently marked that way in the summary. These prompts are a big usability problem for an RCP app I have deployed internally now based on 3.2M4. There are two problems:

1. When you are editing a file which is deleted from disk by another process, then you try to close it, Eclipse always prompts if you want to save the file somewhere or just close. (It's worse for my app because none of my files are in a workspace so saving doesn't actually work, but that's another bug). I just want it to close it, especially if I haven't made any edits in the buffer.

2. When you are editing a file which is modified by another process. Eclipse always prompts if you want to reload the content or not (but only when you click on some other window and click back which is kind of odd). Again, even if you haven't made any edits in the buffer.

My favorite plain text editor, Textpad, handles this pretty well. Under Preferences > File, it has an options group titled "When files are modified by another process:". You chose between Prompt, Auto-Reload, or Ignore. Also, you can set a couple of other toggle options. From the help file (v4.7.3):

"When files are modified by another process: Prompt, Auto-Reload or Ignore.
If an open file is modified by another process: Prompt will ask if it's OK to reload it; Auto-Reload will reload it automatically, unless it's been modified; Ignore will ignore the change." (I run with this set to Auto-Reload)

"Ignore differences in modification times less than 2 seconds.
If you get spurious notifications that a file has been modified, try changing these settings. (MS Windows caches remote files and the cached copy can get out of sync with some Netware and Unix file systems.)"  (I run with this enabled)

"Check for file size changes." (no help on this option but I assume it uses file size changes in addition to modification times. I run with this enabled)

So, here are some ideas for options in the preferences window for all editors. An alternative is to make those two prompt dialogs "sticky" (i.e., "Remember my decision"), but you'd probably have to have a preference option for them anyway so the user could turn the prompts back on if they want.
Comment 4 Susan McCourt CLA 2009-07-15 12:06:11 EDT
"As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009"
Comment 5 Michael Vorburger CLA 2016-11-03 05:44:48 EDT
Just found this very old bug while searching bugzilla, and:

Bug 248068 meanwhile fixed what's described above, I think.

Bug 506960 meanwhile is a new issue for a particular corner case.

I'm thus closing this one.

*** This bug has been marked as a duplicate of bug 248068 ***