Bug 104523

Summary: autodetect a newer modification in file when open a remote file (smb or fish)
Product: [Applications] kate Reporter: GML <gmludo>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: wishlist CC: faure, roy.dragseth, russ
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description GML 2005-04-25 14:40:08 UTC
Version:           inconnu (using KDE 3.4.0, Debian Package 4:3.4.0-0ubuntu3 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
OS:                Linux (i686) release 2.6.10-5-686

When I open a file with remote protocol, if an other user modify this file, kate/kwrite don't signal this.
This fonctionnality works with local files.
Maybe you use the modify date to detect if the file is modified.
Maybe this fonctionnality should be implemented in kio_smb, kio_fish and kio_ftp.
Comment 1 Christoph Cullmann 2005-04-25 18:05:08 UTC
for remote files, there need to be some support in the libs to do that at all useful
Comment 2 David Faure 2005-04-25 18:13:28 UTC
How about stat'ing the file when opening it, stat'ing again before saving, and comparing the modification date?
(by stat I mean KIO::stat of course)

This would be much more robust than expecting to be notified by KIO *when* the file changes,
since that's completely impossible if a remote file is changed by another computer. How would we know?
The only way to detect that a remote (SMB/FISH/FTP) file was changed is to compare its modification
when saving, and offering the "warning: this file has changed" warning at that point.
I don't think you need anything new from KIO for this.
Comment 3 Christoph Cullmann 2005-04-25 18:22:17 UTC
On Monday 25 April 2005 18:13, you wrote:
> How about stat'ing the file when opening it, stat'ing again before saving,
> and comparing the modification date? (by stat I mean KIO::stat of course)
>
> This would be much more robust than expecting to be notified by KIO *when*
> the file changes, since that's completely impossible if a remote file is
> changed by another computer. How would we know? The only way to detect that
> a remote (SMB/FISH/FTP) file was changed is to compare its modification
> when saving, and offering the "warning: this file has changed" warning at
> that point. I don't think you need anything new from KIO for this.

I think he is not talking about saving, but the instant signaling kate does, 
you are right, to stat at close might be way to at least do some last minute 
warning. I think, too, that imediate signaling doesn't work, but me wanted to 
let kio maintainer decide :)
Comment 4 David Faure 2005-04-25 18:34:01 UTC
There definitely can't be instant signalling. Thanks for implementing last minute warning. Hmm. We could use the code in koffice too :) 
[maybe that means it should be done in KParts::ReadWritePart?]
Comment 5 Andrew Mason 2006-12-19 00:04:02 UTC
Not sure if this is useful or not but I don't think you can't stat a file over fish as sshfs has no stat call.

You could check the md5sum on saving to see if its the same as the last save?
i.e get md5, open the file, change the buffer and before saving check that the md5 is still the same as it was when you first opened the file. If its not they can a) reload the file b) merge the changes using kompare or some  other app c) over-write the file.

Comment 6 Andrew Mason 2007-02-15 05:27:16 UTC
could you move this to another section where you think it should be please ..or do we file another report elsewhere  ?
Comment 7 David Faure 2007-02-19 12:56:13 UTC
Well it is done in kate/kwrite already (right?), so the question is which other applications need this.
Comment 8 Andrew Mason 2007-02-19 13:53:17 UTC
Hi David, 
I've tested this in kate/kwrite/quanta/kdevelop . This doesn't work over sshfs(fuse), fish, or samba shares. 
Comment 9 Thomas Friedrichsmeier 2007-12-11 18:04:05 UTC
*** Bug 134121 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Friedrichsmeier 2007-12-12 16:13:55 UTC
*** Bug 40392 has been marked as a duplicate of this bug. ***
Comment 11 Christoph Cullmann 2008-08-13 17:51:20 UTC
Actually, this is a wish...
Comment 12 Christoph Cullmann 2015-10-08 09:05:01 UTC
Dear user,

this wish list item is now closed, as it wasn't touched in the last two years and no contributor stepped up to implement it.

The Kate/KTextEditor team is very small and we can just try to keep up with fixing bugs. Therefore wishs that show no activity for two years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users.

If you want your feature to be implemented, please step up to provide some patch for it. If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in two years again.

We have a nice website kate-editor.org that provides all the information needed to contribute, please make use of it. For highlighting improvements our user manual shows how to write syntax definition files.

Greetings
Christoph