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
This commit is contained in:
Lars Gullik Bjønnes 2005-05-11 16:42:12 +00:00
parent d33531c567
commit a087bda7ec
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-05-11 Lars Gullik Bjonnes <larsbj@gullik.net>
* buffer.C (save): check if destination is writable before trying
to copy a file
2005-05-11 Martin Vermeer <martin.vermeer@hut.fi>
* BufferView_pimpl.C (update): fix processEvents -caused update

View File

@ -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);
//}