From: Lars Gullik Bjønnes Date: Wed, 11 May 2005 16:42:12 +0000 (+0000) Subject: use is_writable to check if the copy_file will work X-Git-Tag: 1.6.10~14299 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a087bda7ec81f48c97d3903ac2c27b688e054e65;p=lyx.git use is_writable to check if the copy_file will work git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9934 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index c7463cf819..a2ab230f32 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-11 Lars Gullik Bjonnes + + * buffer.C (save): check if destination is writable before trying + to copy a file + 2005-05-11 Martin Vermeer * BufferView_pimpl.C (update): fix processEvents -caused update diff --git a/src/buffer.C b/src/buffer.C index ab9a0db5d6..90cc72c46f 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -707,7 +707,7 @@ bool Buffer::save() const // good enough. (Lgb) // But to use this we need fs::copy_file to actually do a copy, // even when the target file exists. (Lgb) - if (fs::exists(fileName())) { + if (fs::exists(fileName()) && fs::is_writable(fs::path(fileName()).branch_path())) { //try { fs::copy_file(fileName(), s, false); //}