After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 75861 - Monitor file changes and deletion
Monitor file changes and deletion
Status: RESOLVED DUPLICATE of bug 371188
Product: gedit
Classification: Applications
Component: general
1.114.0
Other All
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 114215 325654 337891 349451 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-03-22 07:15 UTC by Jathish
Modified: 2006-12-07 17:38 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch with monitors (6.06 KB, patch)
2002-07-09 15:34 UTC, Paolo Maggi
none Details | Review
Another patch using monitors...... (19.17 KB, patch)
2002-07-18 20:28 UTC, James Willcox
needs-work Details | Review

Description Jathish 2002-03-22 07:15:45 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.
Comment 1 Luis Villa 2002-03-28 05:49:47 UTC
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.
Comment 2 Paolo Maggi 2002-03-28 07:50:55 UTC
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 ;-)
Comment 3 Luis Villa 2002-03-30 04:31:14 UTC
Fair enough... I can't really object to that assessment. Should I mark
it down, paolo?
Comment 4 Jathish 2002-03-30 12:50:42 UTC
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?
Comment 5 Paolo Maggi 2002-04-02 07:20:58 UTC
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
Comment 6 Paolo Maggi 2002-06-24 09:05:04 UTC
Note for me: while fixing this bug, test also if a file has beed
modified by another editor (look at the Bluefish code)
Comment 7 Paolo Maggi 2002-07-09 15:33:47 UTC
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.
Comment 8 Paolo Maggi 2002-07-09 15:34:56 UTC
Created attachment 9743 [details] [review]
Patch with monitors
Comment 9 Paolo Maggi 2002-07-10 16:19:33 UTC
Fixed in CVS HEAD (without monitors).
I will implement the solution based on monitors in the future.
Comment 10 James Willcox 2002-07-15 15:09:44 UTC
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).
Comment 11 James Willcox 2002-07-18 20:28:30 UTC
Created attachment 9954 [details] [review]
Another patch using monitors......
Comment 12 Yogeesh 2002-09-19 06:12:21 UTC
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)? 
Comment 13 Paolo Maggi 2002-09-19 12:35:48 UTC
hmmm... the bug itself is fixed.
This is only a memo for me to remember that we should improve the
current solution
Comment 14 Patanjali 2004-04-29 13:56:05 UTC
Comment on attachment 9743 [details] [review]
Patch with monitors

obsoleted by newer patch from james willcox
Comment 15 Paolo Borelli 2005-12-15 20:27:44 UTC
*** Bug 114215 has been marked as a duplicate of this bug. ***
Comment 16 Paolo Borelli 2005-12-15 20:30:53 UTC
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.
Comment 17 Paolo Borelli 2006-01-05 17:02:41 UTC
*** Bug 325654 has been marked as a duplicate of this bug. ***
Comment 18 Paolo Borelli 2006-04-10 08:52:16 UTC
*** Bug 337891 has been marked as a duplicate of this bug. ***
Comment 19 Richard Laager 2006-04-10 08:56:46 UTC
Is this a limitation of the GNOME file monitoring stuff? This works fine in Kate on KDE.
Comment 20 Paolo Borelli 2006-04-10 09:10:04 UTC
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.
Comment 21 Paolo Borelli 2006-07-31 16:15:55 UTC
*** Bug 349451 has been marked as a duplicate of this bug. ***
Comment 22 Daniel Holbach 2006-08-02 10:16:21 UTC
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/gedit/+bug/16661 
Comment 23 Paolo Maggi 2006-12-07 17:38:31 UTC

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