version 1.36.10.1, 2005/09/30 16:28:15
|
version 1.43, 2006/11/10 18:14:58
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// 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 |
|
|
#include <fstream> | #include <fstream> |
#include <cstdio> | #include <cstdio> |
#if defined(PEGASUS_OS_OS400) | #if defined(PEGASUS_OS_OS400) |
#include "OS400ConvertChar.h" |
#include "EBCDIC_OS400.h" |
#endif | #endif |
#include <Pegasus/Common/Buffer.h> | #include <Pegasus/Common/Buffer.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); |
|
|
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 |
|
|
| |
inline String FileSystem::getPathDelimiter() | inline String FileSystem::getPathDelimiter() |
{ | { |
#if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC) |
#if defined(PEGASUS_OS_TYPE_WINDOWS) |
return String(";"); | return String(";"); |
#else | #else |
return String(":"); | return String(":"); |