(file) Return to TraceFileHandler.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/TraceFileHandler.cpp between version 1.27 and 1.31.2.2

version 1.27, 2006/01/30 16:17:08 version 1.31.2.2, 2007/01/11 01:34:35
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Sushma Fernandes, Hewlett-Packard Company (sushma_fernandes@hp.com)  
 //  
 // Modified By: Rudy Schuet (rudy.schuet@compaq.com) 11/12/01  
 //              added nsk platform support  
 //              Amit K Arora, IBM (amita@in.ibm.com) for Bug#1527  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 //#include <fstream>  
 //#include <iostream>  
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
 #include <Pegasus/Common/TraceFileHandler.h> #include <Pegasus/Common/TraceFileHandler.h>
   #include <Pegasus/Common/Executor.h>
  
 #if defined(PEGASUS_OS_TYPE_WINDOWS) #if defined(PEGASUS_OS_TYPE_WINDOWS)
 # include <Pegasus/Common/TraceFileHandlerWindows.cpp> # include <Pegasus/Common/TraceFileHandlerWindows.cpp>
 #elif defined(PEGASUS_OS_TYPE_UNIX)  #elif defined(PEGASUS_OS_TYPE_UNIX) || defined(PEGASUS_OS_VMS)
 # include <Pegasus/Common/TraceFileHandlerUnix.cpp>  # include <Pegasus/Common/TraceFileHandlerPOSIX.cpp>
 #elif defined(PEGASUS_OS_TYPE_NSK)  
 # include <Pegasus/Common/TraceFileHandlerNsk.cpp>  
 #elif defined(PEGASUS_OS_VMS)  
 # include <Pegasus/Common/TraceFileHandlerVms.cpp>  
 #else #else
 # error "Unsupported platform" # error "Unsupported platform"
 #endif #endif
Line 87 
Line 74 
     {     {
         fclose(_fileHandle);         fclose(_fileHandle);
     }     }
     if (_fileName)  
     {  
         delete []_fileName;         delete []_fileName;
     }  
 #ifdef PEGASUS_PLATFORM_LINUX_GENERIC_GNU #ifdef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
     if (_baseFileName)  
     {  
         delete []_baseFileName;         delete []_baseFileName;
     }  
 #endif #endif
 } }
  
Line 143 
Line 124 
 FILE* TraceFileHandler::_openFile(const char* fileName) FILE* TraceFileHandler::_openFile(const char* fileName)
 { {
 #ifdef PEGASUS_OS_VMS #ifdef PEGASUS_OS_VMS
 //    FILE* fileHandle = fopen(fileName,"a+", "shr=get,put,upd");  
     FILE* fileHandle = fopen(fileName,"w", "shr=get,put,upd");     FILE* fileHandle = fopen(fileName,"w", "shr=get,put,upd");
 #else #else
     FILE* fileHandle = fopen(fileName,"a+");      FILE* fileHandle = Executor::openFile(fileName, 'a');
 #endif #endif
     if (!fileHandle)     if (!fileHandle)
     {     {
Line 157 
Line 137 
         return 0;         return 0;
     }     }
  
       // We are done if the executor was used to perform this. Otherwise, we
       // must proceed to fix file ownership and permissions.
   
       if (Executor::detectExecutor() == 0)
           return fileHandle;
   
     //     //
     // Verify that the file has the correct owner     // Verify that the file has the correct owner
     //     //
Line 191 
Line 177 
     return fileHandle;     return fileHandle;
 } }
  
   static bool _canWrite(const String& path)
   {
       if (Executor::detectExecutor() == 0)
           return true;
       else
           return FileSystem::canWrite(path);
   }
   
 Boolean TraceFileHandler::isValidFilePath(const char* filePath) Boolean TraceFileHandler::isValidFilePath(const char* filePath)
 { {
     String fileName = String(filePath);     String fileName = String(filePath);
Line 205 
Line 199 
     // Check if the file exists and is writable     // Check if the file exists and is writable
     if (FileSystem::exists(fileName))     if (FileSystem::exists(fileName))
     {     {
         if (!FileSystem::canWrite(fileName))          if (!_canWrite(fileName))
         {         {
             return 0;             return 0;
         }         }
Line 226 
Line 220 
             {             {
                 return 0;                 return 0;
             }             }
             if (!FileSystem::canWrite(dirName) )              if (!_canWrite(dirName) )
             {             {
                 return 0;                 return 0;
             }             }
Line 243 
Line 237 
             // current working directory             // current working directory
             FileSystem::getCurrentDirectory(currentDir);             FileSystem::getCurrentDirectory(currentDir);
  
             if (!FileSystem::canWrite(currentDir))              if (!_canWrite(currentDir))
             {             {
                 return 0;                 return 0;
             }             }
Line 255 
Line 249 
     }     }
     PEGASUS_UNREACHABLE(return 1;)     PEGASUS_UNREACHABLE(return 1;)
 } }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.27  
changed lines
  Added in v.1.31.2.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2