From a087bda7ec81f48c97d3903ac2c27b688e054e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 11 May 2005 16:42:12 +0000 Subject: [PATCH] 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 --- src/ChangeLog | 5 +++++ src/buffer.C | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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); //}