Bug 364596

Summary: Swap on alternative directory failing
Product: [Applications] kate Reporter: Massimo Burcheri <burcheri.massimo+bugs-kde>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, kare.sars
Priority: NOR    
Version: 3.14.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Massimo Burcheri 2016-06-21 13:07:52 UTC
This is Kate 3.14.21 and kdevelop 4.90.01.

After bug 362288 I tried using an alternative directory for swapping: ~/.kate.swp
But the directory does not get any new files. Attaching strace to kdevelop I found some failed tries to write there:

lstat("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", 0x7ffcc3ad3ac0) = -1 ENOENT (No such file or directory)
open("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 38
lstat("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", {st_mode=S_IFREG|0644, st_size=48, ...}) = 0
unlink("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp") = 0
lstat("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", 0x7ffcc3ad3ac0) = -1 ENOENT (No such file or directory)
open("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 38
lstat("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp", {st_mode=S_IFREG|0644, st_size=48, ...}) = 0
unlink("/home.crypt/mb/.kate.swp/\302\207\302\2147cd\303\217\37Sk\22\30\302\212o\302\234\302\241\303\206\303\274\303\204'\303\226.kate-swp") = 0


Reproducible: Always
Comment 1 Christoph Cullmann 2016-09-04 14:27:32 UTC
Think have a fix for that:

https://phabricator.kde.org/D2653
Comment 2 Kåre Särs 2016-09-04 14:31:15 UTC
This is fixed already in KTextEditor (to be KF5.26) even without the new review
Comment 3 Christoph Cullmann 2016-09-05 09:58:59 UTC
Ok, nice to know.
Btw., I submitted my revision, that will make the file names actually encoded in some sensible manner and connect the swap files to file name not content.