D14890: remove QSaveFile in favor of plain old file saving rational: for many use cases that e.g. have acls, complex other extended attributes, static links e.g. the rename() doesnt do the trick it should other ways would be start to add workarounds to...

David Faure noreply at phabricator.kde.org
Thu Aug 16 22:25:13 BST 2018


dfaure added a comment.


  I just tested how vim handles this. No QSaveFile-like behaviour (direct write, says strace), and in case of partition full, this error message appears:
  
  "myfile" E514: write error (file system full?)
  
  WARNING: Original file may be lost or damaged
  don't quit the editor until the file is successfully written!
  
  That's the beautiful difference between a text editor and a program saving a config file or whatever else: you can leave the editor open so the data is not lost!
  I recommend that kate implements something similar, if not already done.
  
  For the curious, here's how I investigated vim's behaviour without filling my real partition:
  
    cd /tmp
    dd if=/dev/zero of=loopback count=200
    sudo mkfs.ext2 loopback
    sudo mount -o loop loopback mnt
    sudo chown $USER:$GID mnt
    cd mnt
    yes > myfile
      # (this ends with "No space left on device")
    vim myfile
    
    # elsewhere: strace -e file -p `pidof vim`
    
    in vim, paste a whole bunch of additional text into the file, save

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D14890

To: cullmann, dhaumann
Cc: dfaure, kwrite-devel, kde-frameworks-devel, michaelh, kevinapavew, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180816/723b215e/attachment.html>


More information about the KWrite-Devel mailing list