version 1.1.2.2, 2001/10/30 00:48:04
|
version 1.3, 2002/03/12 19:41:44
|
|
|
// Author: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) | // Author: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
// | // |
// Modified By: | // Modified By: |
|
// Ramnath Ravindran (Ramnath.Ravindan@compaq.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
#include <Pegasus/Common/Config.h> |
#include <fstream> | #include <fstream> |
#include <Pegasus/Common/Destroyer.h> | #include <Pegasus/Common/Destroyer.h> |
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
|
|
| |
ArrayDestroyer<char> p(path.allocateCString(4)); | ArrayDestroyer<char> p(path.allocateCString(4)); |
strcat(p.getPointer(), ".tmp"); | strcat(p.getPointer(), ".tmp"); |
ofstream os(p.getPointer(), ios::app | ios::binary); |
ofstream os(p.getPointer(), ios::app PEGASUS_OR_IOS_BINARY); |
| |
if (!os) | if (!os) |
{ | { |
|
|
if (FileSystem::existsNoCase(path, realPath)) | if (FileSystem::existsNoCase(path, realPath)) |
{ | { |
ArrayDestroyer<char> p(realPath.allocateCString()); | ArrayDestroyer<char> p(realPath.allocateCString()); |
ifstream is(p.getPointer(), ios::binary); |
ifstream is(p.getPointer() PEGASUS_IOS_BINARY); |
| |
if (!is) | if (!is) |
{ | { |
|
|
| |
ArrayDestroyer<char> p(realPath.allocateCString(4)); | ArrayDestroyer<char> p(realPath.allocateCString(4)); |
strcat(p.getPointer(), ".tmp"); | strcat(p.getPointer(), ".tmp"); |
ofstream os(p.getPointer(), ios::app | ios::binary); |
ofstream os(p.getPointer(), ios::app PEGASUS_OR_IOS_BINARY); |
| |
if (!os) | if (!os) |
{ | { |
|
|
| |
ArrayDestroyer<char> p(realPath.allocateCString(4)); | ArrayDestroyer<char> p(realPath.allocateCString(4)); |
strcat(p.getPointer(), ".tmp"); | strcat(p.getPointer(), ".tmp"); |
ofstream os(p.getPointer(), ios::app | ios::binary); |
ofstream os(p.getPointer(), ios::app PEGASUS_OR_IOS_BINARY); |
| |
if (!os) | if (!os) |
{ | { |
|
|
// open the instance file | // open the instance file |
// | // |
ArrayDestroyer<char> p(path.allocateCString()); | ArrayDestroyer<char> p(path.allocateCString()); |
ifstream is(p.getPointer(), ios::in | ios::binary); |
ifstream is(p.getPointer(), ios::in PEGASUS_OR_IOS_BINARY); |
| |
if (!is) | if (!is) |
{ | { |
|
|
// Open the instance file | // Open the instance file |
// | // |
ArrayDestroyer<char> q(realPath.allocateCString()); | ArrayDestroyer<char> q(realPath.allocateCString()); |
ifstream is(q.getPointer(), ios::in | ios::binary); |
ifstream is(q.getPointer(), ios::in PEGASUS_OR_IOS_BINARY); |
| |
if (!is) | if (!is) |
{ | { |