version 1.40, 2006/08/09 21:12:42
|
version 1.44, 2007/02/09 19:22:43
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_FileSystem_h | #ifndef Pegasus_FileSystem_h |
|
|
@return the full absolute pathname to the found filename or an empty | @return the full absolute pathname to the found filename or an empty |
string on failure. | string on failure. |
*/ | */ |
static String getAbsoluteFileName(const String &paths, const String &filename); |
static String getAbsoluteFileName( |
|
const String& paths, |
|
const String& filename); |
| |
/** | /** |
Convert a library name to its corresponding file name by adding the | Convert a library name to its corresponding file name by adding the |
|
|
*/ | */ |
static String buildLibraryFileName(const String &libraryName); | static String buildLibraryFileName(const String &libraryName); |
| |
|
static Boolean changeFileOwner( |
|
const String& fileName, |
|
const String& userName); |
|
|
|
/** |
|
Flushes the data from the iostream buffers to the OS buffers and |
|
then flushes the data from the OS buffers to the disk. |
|
|
|
This will avoid the possible data loss in case of an OS crash when |
|
OS filesystem commit directory-level changes immediately while |
|
file-level changes remain cached (e.g. HP-UX). |
|
|
|
@param fstream. The iostream that we want to flush data. |
|
*/ |
|
static void syncWithDirectoryUpdates(fstream&); |
|
|
private: | private: |
| |
FileSystem() { } | FileSystem() { } |
|
|
inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path) | inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path) |
{ | { |
#if defined(PEGASUS_OS_OS400) | #if defined(PEGASUS_OS_OS400) |
os.open(path.getCString(), PEGASUS_STD(ios::app), PEGASUS_STD(_CCSID_T(1208))); |
os.open( |
|
path.getCString(), PEGASUS_STD(ios::app), PEGASUS_STD(_CCSID_T(1208))); |
#else | #else |
os.open(path.getCString(), PEGASUS_STD(ios::app)); | os.open(path.getCString(), PEGASUS_STD(ios::app)); |
#endif | #endif |