Index: ossp-pkg/as/as-gui/as_sfile.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_sfile.cpp,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_sfile.cpp,v' 2>/dev/null --- as_sfile.cpp 2003/02/08 18:10:09 1.1 +++ as_sfile.cpp 2003/02/13 21:32:36 1.2 @@ -48,14 +48,16 @@ Q_ASSERT(!this->exists()); // Conditionally short circuit Fname = this->name(); // Copy filename from original Filein.setName(Fname); // Set filename of original - Filein.open(IO_ReadOnly); // Open original read-only - Filebak.setName(Fname + ".bak"); // Set filename of backup - Filebak.open(IO_WriteOnly); // Open backup write-only - Streamin.setDevice(&Filein); // Set incoming stream - Streambak.setDevice(&Filebak); // Set outgoing stream - Streambak << Streamin.read(); // Do actual writing - Filein.close(); // Close original - Filebak.close(); // Close backup + if (Filein.exists()) { // Can only backup an existing file + Filein.open(IO_ReadOnly); // Open original read-only + Filebak.setName(Fname + ".bak"); // Set filename of backup + Filebak.open(IO_WriteOnly); // Open backup write-only + Streamin.setDevice(&Filein); // Set incoming stream + Streambak.setDevice(&Filebak); // Set outgoing stream + Streambak << Streamin.read(); // Do actual writing + Filein.close(); // Close original + Filebak.close(); // Close backup + } } catch (Genexcept& Genex) { Genex.reportErr();