diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp
index 16fc365da1be7ec9d773181bd43611ae6279d90b..f8a93baf452c0bd4cb2bb4dadb647808f5523aba 100644
--- a/indra/llcommon/llmetricperformancetester.cpp
+++ b/indra/llcommon/llmetricperformancetester.cpp
@@ -132,8 +132,8 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std
 	}
 	
 	// Open baseline and current target, exit if one is inexistent
-	std::ifstream base_is(baseline.c_str());
-	std::ifstream target_is(target.c_str());
+	llifstream base_is(baseline.c_str());
+	llifstream target_is(target.c_str());
 	if (!base_is.is_open() || !target_is.is_open())
 	{
 		LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL;
@@ -151,7 +151,7 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std
 	target_is.close();
 	
 	//output comparision
-	std::ofstream os(output.c_str());
+	llofstream os(output.c_str());
 	
 	os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; 
 	for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; 
@@ -212,7 +212,7 @@ void LLMetricPerformanceTesterBasic::addMetric(std::string str)
 }
 
 /*virtual*/ 
-void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) 
+void LLMetricPerformanceTesterBasic::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) 
 {
 	resetCurrentCount() ;
 
@@ -254,14 +254,14 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD*
 }
 
 /*virtual*/ 
-void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) 
+void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) 
 {
 	*os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, 
 						v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ;
 }
 
 /*virtual*/ 
-void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) 
+void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) 
 {
 	*os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current,						
 						v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ;
@@ -293,7 +293,7 @@ LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession()
 }
 
 /*virtual*/ 
-void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) 
+void LLMetricPerformanceTesterWithSession::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) 
 {
 	// Load the base session
 	resetCurrentCount() ;
diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h
index e6b46be1cf905f193652bb2458ee8e6e573eb738..2e99ed979df939396b3d2bcbbaaf40737cd3b9a7 100644
--- a/indra/llcommon/llmetricperformancetester.h
+++ b/indra/llcommon/llmetricperformancetester.h
@@ -60,7 +60,7 @@ public:
 	 * By default, compares the test results against the baseline one by one, item by item, 
 	 * in the increasing order of the LLSD record counter, starting from the first one.
 	 */
-	virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ;
+	virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ;
 
 	static void doAnalysisMetrics(std::string baseline, std::string target, std::string output) ;
 
@@ -93,8 +93,8 @@ protected:
 	 * @param[in] v_base - Base value of the metric.
 	 * @param[in] v_current - Current value of the metric.
 	 */
-	virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ;
-	virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ;
+	virtual void compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) ;
+	virtual void compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) ;
 
 	/**
 	 * @brief Reset internal record count. Count starts with 1.
@@ -181,7 +181,7 @@ public:
 	 * This will be loading the base and current sessions and compare them using the virtual 
 	 * abstract methods loadTestSession() and compareTestSessions()
 	 */
-	virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ;
+	virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ;
 
 protected:
 	/**
@@ -205,7 +205,7 @@ protected:
 	 * @brief Compare the base session and the target session. Assumes base and current sessions have been loaded.
 	 * @param[out] os - The comparison result as a standard stream
 	 */
-	virtual void compareTestSessions(std::ofstream* os) = 0;
+	virtual void compareTestSessions(llofstream* os) = 0;
 
 	LLTestSession* mBaseSessionp;
 	LLTestSession* mCurrentSessionp;
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 7757198af525935904294419c8e4752decee956e..1847c661d738766f3763a3246a105b4421eda9e1 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -65,7 +65,7 @@ static const std::string HEADLESS_VENDOR_STRING("Linden Lab");
 static const std::string HEADLESS_RENDERER_STRING("Headless");
 static const std::string HEADLESS_VERSION_STRING("1.0");
 
-std::ofstream gFailLog;
+llofstream gFailLog;
 
 #if GL_ARB_debug_output
 
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 75e5fe86ec0ce1447b6df43b9fc62c3afe7fa0da..aa98b3f6bc635992f59132175486c58b59506bec 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -47,7 +47,7 @@
 
 extern BOOL gDebugGL;
 extern BOOL gDebugSession;
-extern std::ofstream gFailLog;
+extern llofstream gFailLog;
 
 #define LL_GL_ERRS LL_ERRS("RenderState")
 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 98d622acf933b1d8ec5b87ed3661a51a50347e85..b7267fbdfe4b663046959676e5ac596f79bc7bf1 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -639,7 +639,7 @@ public:
 
 	void run()
 	{
-		std::ofstream os(mFile.c_str());
+		llofstream os(mFile.c_str());
 		
 		while (!LLAppViewer::instance()->isQuitting())
 		{
@@ -3737,7 +3737,7 @@ void getFileList()
 		if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) )
 		{
 			std::string fullname = pathname + *iter;
-			std::ifstream fdat( fullname.c_str(), std::ifstream::binary);
+			llifstream fdat( fullname.c_str(), std::ifstream::binary);
 			if (fdat)
 			{
 				char buf[5];
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index a69b3b7dc70fa8bc25d60eaa946ddd1112940b25..4110971fa54e1cb264fe53fa096d3857da3af441 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -463,7 +463,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
 
 	{ //read base log into memory
 		S32 i = 0;
-		std::ifstream is(base.c_str());
+		llifstream is(base.c_str());
 		while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is))
 		{
 			base_data[i++] = cur;
@@ -476,7 +476,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
 
 	{ //read current log into memory
 		S32 i = 0;
-		std::ifstream is(target.c_str());
+		llifstream is(target.c_str());
 		while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is))
 		{
 			cur_data[i++] = cur;
@@ -821,8 +821,8 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is)
 void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target, std::string output)
 {
 	// Open baseline and current target, exit if one is inexistent
-	std::ifstream base_is(baseline.c_str());
-	std::ifstream target_is(target.c_str());
+	llifstream base_is(baseline.c_str());
+	llifstream target_is(target.c_str());
 	if (!base_is.is_open() || !target_is.is_open())
 	{
 		LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL;
@@ -840,7 +840,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target
 	target_is.close();
 
 	//output comparison
-	std::ofstream os(output.c_str());
+	llofstream os(output.c_str());
 
 	LLSD::Real session_time = current["SessionTime"].asReal();
 	os <<
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index c2a0393170e02c9705bf17bf3bef45431c6ac3c5..b65e7ef35276c30734c924bd353d43db0f4b0dd5 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1980,14 +1980,14 @@ void dump_llsd_to_file(const LLSD& content, std::string filename)
 {
 	if (gSavedSettings.getBOOL("MeshUploadLogXML"))
 	{
-		std::ofstream of(filename.c_str());
+		llofstream of(filename.c_str());
 		LLSDSerialize::toPrettyXML(content,of);
 	}
 }
 
 LLSD llsd_from_file(std::string filename)
 {
-	std::ifstream ifs(filename.c_str());
+	llifstream ifs(filename.c_str());
 	LLSD result;
 	LLSDSerialize::fromXML(result,ifs);
 	return result;
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 2476b6d6ed4b3856cee8fe8cfd31f315d98b10ea..6ecc4c7fb91ed40600bd3dbd5509dce6e662a733 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1214,7 +1214,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
 
 	std::string filename = file_picker.getFirstFile();
 
-	std::ifstream fin(filename.c_str());
+	llifstream fin(filename.c_str());
 
 	std::string line;
 	std::string text;
@@ -1252,7 +1252,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata )
 		{
 			std::string filename = file_picker.getFirstFile();
 			std::string scriptText=self->mEditor->getText();
-			std::ofstream fout(filename.c_str());
+			llofstream fout(filename.c_str());
 			fout<<(scriptText);
 			fout.close();
 			self->mSaveCallback( self->mUserdata, FALSE );
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
index 02912f12a99f47fea5d6448710ec511e45a7fb09..5ab00130557223c47a49007bc808e39951ed18c5 100644
--- a/indra/newview/llscenemonitor.cpp
+++ b/indra/newview/llscenemonitor.cpp
@@ -532,7 +532,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
 
 	LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL; 
 
-	std::ofstream os(file_name.c_str());
+	llofstream os(file_name.c_str());
 
 	os << std::setprecision(10);
 
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index cd8dd54fa63128e2cfa79bfbf862e0bd6271a7de..5de7df7b9100d7bb9bff3d7825e55e858852f0c0 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -3966,7 +3966,7 @@ void LLTexturePipelineTester::updateStablizingTime()
 }
 
 //virtual 
-void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) 
+void LLTexturePipelineTester::compareTestSessions(llofstream* os) 
 {	
 	LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mBaseSessionp);
 	LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mCurrentSessionp);
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 8017d8260418e27b9a366af9c848535739d40771..c9dea17f63b77fa03036f3d450f0240f423d35fe 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -779,7 +779,7 @@ private:
 	};
 
 	/*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ;
-	/*virtual*/ void compareTestSessions(std::ofstream* os) ;
+	/*virtual*/ void compareTestSessions(llofstream* os) ;
 };
 
 #endif
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f9dfa971d9ae26bb3ec3a247b1d420196c577005..1658adea08b9452fcf0d90450cc0d03902abaa92 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -8435,7 +8435,7 @@ void dump_sequential_xml(const std::string outprefix, const LLSD& content)
 {
 	std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
 	std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
-	std::ofstream ofs(fullpath.c_str(), std::ios_base::out);
+	llofstream ofs(fullpath.c_str(), std::ios_base::out);
 	ofs << LLSDOStreamer<LLSDXMLFormatter>(content, LLSDFormatter::OPTIONS_PRETTY);
 	LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL;
 }
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 630af2b73bb9145af9f653e966e5067ae69ea001..1c0317df1dbdb992d35f181bef3b0eca513cdb15 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -136,7 +136,7 @@ public:
 
 private:
 	NamedTempFile mTempFile;
-	std::ofstream mFile;
+	llofstream mFile;
 };
 
 class LLReplayLogReal: public LLReplayLog, public boost::noncopyable
@@ -569,7 +569,7 @@ int main(int argc, char **argv)
 	apr_status_t apr_err;
 	const char* opt_arg = NULL;
 	int opt_id = 0;
-	boost::scoped_ptr<std::ofstream> output;
+	boost::scoped_ptr<llofstream> output;
 	const char *touch = NULL;
 
 	while(true)
@@ -599,7 +599,7 @@ int main(int argc, char **argv)
 				verbose_mode = true;
 				break;
 			case 'o':
-				output.reset(new std::ofstream);
+				output.reset(new llofstream);
 				output->open(opt_arg);
 				break;
 			case 's':	// --sourcedir
@@ -673,7 +673,7 @@ int main(int argc, char **argv)
 
 	if (touch && success)
 	{
-		std::ofstream s;
+		llofstream s;
 		s.open(touch);
 		s << "ok" << std::endl;
 		s.close();