Index: /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp
===================================================================
--- /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp	(revision 102183)
+++ /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp	(revision 102184)
@@ -137,35 +137,11 @@
     AssertRC(vrc); RT_NOREF(vrc);
 
-    const char* statsFilename = RTEnvGet("MOZILLA_XPTI_STATS");
-    if(statsFilename)
-    {
-        mStatsLogFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);         
-        if(mStatsLogFile && 
-           NS_SUCCEEDED(mStatsLogFile->InitWithNativePath(nsDependentCString(statsFilename))))
-        {
-            printf("* Logging xptinfo stats to: %s\n", statsFilename);
-        }
-        else
-        {
-            printf("* Failed to create xptinfo stats file: %s\n", statsFilename);
-            mStatsLogFile = nsnull;
-        }
-    }
-
-    const char* autoRegFilename = RTEnvGet("MOZILLA_XPTI_REGLOG");
-    if(autoRegFilename)
-    {
-        mAutoRegLogFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);         
-        if(mAutoRegLogFile && 
-           NS_SUCCEEDED(mAutoRegLogFile->InitWithNativePath(nsDependentCString(autoRegFilename))))
-        {
-            printf("* Logging xptinfo autoreg to: %s\n", autoRegFilename);
-        }
-        else
-        {
-            printf("* Failed to create xptinfo autoreg file: %s\n", autoRegFilename);
-            mAutoRegLogFile = nsnull;
-        }
-    }
+    mStatsLogFile = RTEnvGet("MOZILLA_XPTI_STATS");
+    if (mStatsLogFile)
+        printf("* Logging xptinfo stats to: %s\n", mStatsLogFile);
+
+    mAutoRegLogFile = RTEnvGet("MOZILLA_XPTI_REGLOG");
+    if (mAutoRegLogFile)
+        printf("* Logging xptinfo autoreg to: %s\n", mAutoRegLogFile);
 }
 
@@ -1624,10 +1600,10 @@
         return;
 
-    PRFileDesc* fd = gInterfaceInfoManager->GetOpenLogFile();
+    PRTSTREAM fd = gInterfaceInfoManager->GetOpenLogFile();
     if(fd)
     {
         va_list ap;
         va_start(ap, fmt);
-        PR_vfprintf(fd, fmt, ap);
+        RTStrmPrintfV(fd, fmt, ap);
         va_end(ap);
     }
@@ -1644,5 +1620,5 @@
     {
         xptiWorkingSet*  aWorkingSet = mgr->GetWorkingSet();
-        PRFileDesc* fd = mgr->GetOpenLogFile();
+        PRTSTREAM fd = mgr->GetOpenLogFile();
 
         const xptiTypelib& typelib = entry->GetTypelibRecord();
@@ -1654,11 +1630,11 @@
             const char* zipItemName = 
                 aWorkingSet->GetZipItemAt(typelib.GetZipItemIndex()).GetName();
-            PR_fprintf(fd, "xpti used interface: %s from %s::%s\n", 
-                       entry->GetTheName(), filename, zipItemName);
+            RTStrmPrintf(fd, "xpti used interface: %s from %s::%s\n", 
+                         entry->GetTheName(), filename, zipItemName);
         }    
         else
         {
-            PR_fprintf(fd, "xpti used interface: %s from %s\n", 
-                       entry->GetTheName(), filename);
+            RTStrmPrintf(fd, "xpti used interface: %s from %s\n", 
+                         entry->GetTheName(), filename);
         }
     }
@@ -1674,5 +1650,5 @@
     xptiAutoLog autoLog(this, mStatsLogFile, PR_FALSE);
 
-    PRFileDesc* fd = GetOpenLogFile();
+    PRTSTREAM fd = GetOpenLogFile();
     if(!fd)
         return;
@@ -1686,8 +1662,8 @@
         xptiFile& f = mWorkingSet.GetFileAt(i);
         if(f.GetGuts())
-            PR_fprintf(fd, "xpti used file: %s\n", f.GetName());
-    }
-
-    PR_fprintf(fd, "\n");
+            RTStrmPrintf(fd, "xpti used file: %s\n", f.GetName());
+    }
+
+    RTStrmPrintf(fd, "\n");
 
     // Show names of xptfiles loaded from zips from which at least 
@@ -1699,8 +1675,8 @@
         xptiZipItem& zi = mWorkingSet.GetZipItemAt(i);
         if(zi.GetGuts())                           
-            PR_fprintf(fd, "xpti used file from zip: %s\n", zi.GetName());
-    }
-
-    PR_fprintf(fd, "\n");
+            RTStrmPrintf(fd, "xpti used file from zip: %s\n", zi.GetName());
+    }
+
+    RTStrmPrintf(fd, "\n");
 
     // Show name of each interface that was fully resolved and the name
Index: /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiMisc.cpp
===================================================================
--- /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiMisc.cpp	(revision 102183)
+++ /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiMisc.cpp	(revision 102184)
@@ -40,4 +40,5 @@
 /* Implementation of misc. xpti stuff. */
 
+#include <iprt/file.h>
 #include <iprt/time.h>
 
@@ -77,5 +78,5 @@
 
 xptiAutoLog::xptiAutoLog(xptiInterfaceInfoManager* mgr, 
-                         nsILocalFile* logfile, PRBool append)
+                         const char *logfile, PRBool append)
     : mMgr(nsnull), mOldFileDesc(nsnull)
 {
@@ -84,18 +85,23 @@
     if(mgr && logfile)
     {
-        PRFileDesc* fd;
-        if(NS_SUCCEEDED(logfile->
-                    OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE | PR_APPEND |
-                                             (append ? 0 : PR_TRUNCATE),
-                                             0600, &fd)) && fd)
+        RTFILE hFile      = NIL_RTFILE;
+        PRTSTREAM pStream = NULL;
+        int vrc = RTFileOpen(&hFile, logfile,
+                             RTFILE_O_OPEN_CREATE | RTFILE_O_WRITE | RTFILE_O_APPEND | RTFILE_O_DENY_NONE
+                             | (append ? 0 : RTFILE_O_TRUNCATE)
+                             | (0600 << RTFILE_O_CREATE_MODE_SHIFT));
+        if (RT_SUCCESS(vrc))
+            vrc = RTStrmOpenFileHandle(hFile, "at", 0 /*fFlags*/, &pStream);
+
+        if (RT_SUCCESS(vrc))
         {
 #ifdef DEBUG
-            m_DEBUG_FileDesc = fd;
+            m_DEBUG_FileDesc = pStream;
 #endif
             mMgr = mgr;
-            mOldFileDesc = mMgr->SetOpenLogFile(fd);
-            if(append)
-                PR_Seek(fd, 0, PR_SEEK_END);
-            WriteTimestamp(fd, "++++ start logging ");
+            mOldFileDesc = mMgr->SetOpenLogFile(pStream);
+            if (append)
+                RTStrmSeek(pStream, 0, RTFILE_SEEK_END);
+            WriteTimestamp(pStream, "++++ start logging ");
 
         }
@@ -103,6 +109,9 @@
         {
 #ifdef DEBUG
-        printf("xpti failed to open log file for writing\n");
+            printf("xpti failed to open log file for writing\n");
 #endif
+            if (hFile != NIL_RTFILE)
+                RTFileClose(hFile);
+            hFile = NIL_RTFILE;
         }
     }
@@ -115,15 +124,15 @@
     if(mMgr)
     {
-        PRFileDesc* fd = mMgr->SetOpenLogFile(mOldFileDesc);
+        PRTSTREAM fd = mMgr->SetOpenLogFile(mOldFileDesc);
         NS_ASSERTION(fd == m_DEBUG_FileDesc, "bad unravel");
         if(fd)
         {
             WriteTimestamp(fd, "---- end logging   ");
-            PR_Close(fd);
+            RTStrmClose(fd);
         }
     }
 }
 
-void xptiAutoLog::WriteTimestamp(PRFileDesc* fd, const char* msg)
+void xptiAutoLog::WriteTimestamp(PRTSTREAM pStream, const char* msg)
 {
     RTTIMESPEC TimeSpec;
@@ -135,5 +144,5 @@
     char time[128];
     RTTimeToString(&Time, time, sizeof(time));
-    PR_fprintf(fd, "\n%s %s\n\n", msg, time);
+    RTStrmPrintf(pStream, "\n%s %s\n\n", msg, time);
 }
 
Index: /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiprivate.h
===================================================================
--- /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiprivate.h	(revision 102183)
+++ /trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiprivate.h	(revision 102184)
@@ -43,4 +43,6 @@
 #define xptiprivate_h___
 
+#include <iprt/stream.h>
+
 #include "nscore.h"
 #include "nsISupports.h"
@@ -843,13 +845,13 @@
     xptiAutoLog();  // not implemented
     xptiAutoLog(xptiInterfaceInfoManager* mgr,
-                nsILocalFile* logfile, PRBool append);
+                const char *logfile, PRBool append);
     ~xptiAutoLog();
 private:
-    void WriteTimestamp(PRFileDesc* fd, const char* msg);
+    void WriteTimestamp(PRTSTREAM pStream, const char* msg);
 
     xptiInterfaceInfoManager* mMgr;
-    PRFileDesc* mOldFileDesc;
+    PRTSTREAM mOldFileDesc;
 #ifdef DEBUG
-    PRFileDesc* m_DEBUG_FileDesc;
+    PRTSTREAM m_DEBUG_FileDesc;
 #endif
 };
@@ -876,7 +878,7 @@
 
     xptiWorkingSet*  GetWorkingSet() {return &mWorkingSet;}
-    PRFileDesc*      GetOpenLogFile() {return mOpenLogFile;}
-    PRFileDesc*      SetOpenLogFile(PRFileDesc* fd) 
-        {PRFileDesc* temp = mOpenLogFile; mOpenLogFile = fd; return temp;}
+    PRTSTREAM        GetOpenLogFile() {return mOpenLogFile;}
+    PRTSTREAM        SetOpenLogFile(PRTSTREAM pStream) 
+        {PRTSTREAM temp = mOpenLogFile; mOpenLogFile = pStream; return temp;}
 
     PRBool LoadFile(const xptiTypelib& aTypelibRecord,
@@ -958,7 +960,7 @@
 private:
     xptiWorkingSet               mWorkingSet;
-    nsCOMPtr<nsILocalFile>       mStatsLogFile;
-    nsCOMPtr<nsILocalFile>       mAutoRegLogFile;
-    PRFileDesc*                  mOpenLogFile;
+    const char                   *mStatsLogFile;
+    const char                   *mAutoRegLogFile;
+    PRTSTREAM                    mOpenLogFile;
     RTSEMFASTMUTEX               mResolveLock;
     RTSEMFASTMUTEX               mAutoRegLock;
