version 1.85, 2008/12/16 18:55:59
|
version 1.85.8.2, 2014/03/12 22:35:02
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <iostream> | #include <iostream> |
//#include <cstdio> |
|
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/AutoPtr.h> | #include <Pegasus/Common/AutoPtr.h> |
|
|
#include <pwd.h> | #include <pwd.h> |
#endif | #endif |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
// Clone the path as a C String but discard trailing slash if any: | // Clone the path as a C String but discard trailing slash if any: |
|
|
return root; | return root; |
} | } |
| |
|
|
String FileSystem::buildLibraryFileName(const String &libraryName) | String FileSystem::buildLibraryFileName(const String &libraryName) |
{ | { |
String fileName; | String fileName; |
|
|
{ | { |
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
return String(".dll"); | return String(".dll"); |
#elif defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC) |
#elif defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC) || \ |
|
defined (PEGASUS_PLATFORM_HPUX_PARISC_GNU) |
return String(".sl"); | return String(".sl"); |
#elif defined(PEGASUS_OS_DARWIN) | #elif defined(PEGASUS_OS_DARWIN) |
return String(".dylib"); | return String(".dylib"); |
|
|
#endif | #endif |
} | } |
| |
|
#if defined(PEGASUS_OS_HPUX) |
void FileSystem::syncWithDirectoryUpdates(PEGASUS_STD(fstream)& fs) | void FileSystem::syncWithDirectoryUpdates(PEGASUS_STD(fstream)& fs) |
{ | { |
#if defined(PEGASUS_OS_HPUX) |
#if defined (PEGASUS_PLATFORM_HPUX_IA64_GNU) || \ |
|
defined (PEGASUS_PLATFORM_HPUX_PARISC_GNU) |
|
// Writes the data from the iostream buffers to the OS buffers |
|
fs.flush(); |
|
// Writes the data from the OS buffers to the disk |
|
fs.rdbuf()->pubsync(); |
|
#else |
// Writes the data from the iostream buffers to the OS buffers | // Writes the data from the iostream buffers to the OS buffers |
fs.flush(); | fs.flush(); |
// Writes the data from the OS buffers to the disk | // Writes the data from the OS buffers to the disk |
fsync(fs.rdbuf()->fd()); | fsync(fs.rdbuf()->fd()); |
#endif | #endif |
} | } |
|
#else |
|
void FileSystem::syncWithDirectoryUpdates(PEGASUS_STD(fstream)&) |
|
{ |
|
//Not HP-UX, do nothing (compiler will remove this fct on optimization) |
|
} |
|
#endif |
| |
Boolean FileSystem::glob( | Boolean FileSystem::glob( |
const String& path, | const String& path, |