GNOME Bugzilla – Bug 75861
Monitor file changes and deletion
Last modified: 2006-12-07 17:38:31 UTC
Gnome Beta 2 was built on a Solaris 9 (32 bit) sun sparc machine. Description: gedit does not prompt for saving a file if the file is deleting when in use. Steps to simulate: 1. Open a file say samp.txt 2. Click on "File -> Open" and select the same file being edited "samp.txt", 3. click on "Delete File" button 4. Click on "Ok" button The file gets deleted. DO NOT make any modifications to the file Click on File-> Close Gedit does not prompt for saving the file and the file is deleted from the disk also.
I hesitate to raise the priority on this one, since it's sort of an edge case, but it definitely could cause data loss, so I'm marking to blocker.
I'm not sure this is a blocker and it is not on the top of my priorities. I will fix it when I will have time (I hope before gnome 2.0, but not sure). For example, gvim on my RedHat 7.2 box has the same problem (I know they fix it in gvim 6.0) gedit users are not so masochist... I hope ;-)
Fair enough... I can't really object to that assessment. Should I mark it down, paolo?
Thats just one of reproducing the bug. Gedit does not prompt for "Save" even if the file is deleted from command prompt. Does this scenario seem realistic?
Actually, I always thought to this last scenario. To summarize: Yes, it is a possible scenario. Yes, it is a bug. Yes, I will fix it when I will have time. Yes, it could cause data loss No, IMHO it is not a blocker. I'm going to ser Severity to Major
Note for me: while fixing this bug, test also if a file has beed modified by another editor (look at the Bluefish code)
I'm attaching a patch containing a possible solution based on monitors. This patch is not ready to go in, but it contains some idea I'd like to implement for gnome 2.2 This patch does not works if we open the same file more than once. I think, in the future, gedit should not open the same file more than once.
Created attachment 9743 [details] [review] Patch with monitors
Fixed in CVS HEAD (without monitors). I will implement the solution based on monitors in the future.
Re-opening this bug at Paolo's request. I have another patch that uses monitoring that I will attach later (I don't have it on this machine).
Created attachment 9954 [details] [review] Another patch using monitors......
Paolo: I verified ur patch(without monitors) on solaris with sun's beta2 build8 dated 27th Aug from cvs. I do get a dialog to save the file which was deleted and selected for close. bug is seems to be fixed, could u please look into the patch given by james (with monitors)?
hmmm... the bug itself is fixed. This is only a memo for me to remember that we should improve the current solution
Comment on attachment 9743 [details] [review] Patch with monitors obsoleted by newer patch from james willcox
*** Bug 114215 has been marked as a duplicate of this bug. ***
Bug 114215 asks about monitoring external file changes. This is obviosly related. If/when we implement file monitoring, both deletion and external changes will be monitored. Updating the summary. Currently we don't feel that the available file monitoring tecnologies are stable and reliable enough.
*** Bug 325654 has been marked as a duplicate of this bug. ***
*** Bug 337891 has been marked as a duplicate of this bug. ***
Is this a limitation of the GNOME file monitoring stuff? This works fine in Kate on KDE.
No, it's not gnome specific. FAM and gamin are known to have problems. inotify improves things a bit, but it is still too new and linux specific. "it works fine" when it works, but there are cases where it doesn't, so we prefer to be conservative about it.
*** Bug 349451 has been marked as a duplicate of this bug. ***
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/gedit/+bug/16661
*** This bug has been marked as a duplicate of 371188 ***