diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 1bbe878bbaa8988bd31f97078b8154944ddb6175..5ca9f55ac8ce9d33fa2a4cb905e705cd5d5f538e 100755
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const
 
 BOOL LLWearable::exportFile(const std::string& filename) const
 {
-	std::ofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
+	llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
 	return ofs.is_open() && exportStream(ofs);
 }
 
@@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
 LLWearable::EImportResult LLWearable::importFile(const std::string& filename,
 												 LLAvatarAppearance* avatarp )
 {
-	std::ifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
+	llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
 	return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp);
 }
 
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 3cb81b4e47686159bafb2bf0d57d3c5ed4d25099..2100989316446e087dc021711f70f357c5d37320 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -135,7 +135,7 @@ namespace {
 		}
 	
 	private:
-		std::ofstream mFile;
+		llofstream mFile;
 	};
 	
 	
@@ -335,7 +335,7 @@ namespace
 		LLSD configuration;
 
 		{
-			std::ifstream file(filename().c_str());
+			llifstream file(filename().c_str());
 			if (file.is_open())
 			{
 				LLSDSerialize::fromXML(configuration, file);
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index ab432a923dfdd310e1a1c1c22c87709f7d45b3aa..295c97eac8949543d8fa79ffbd43d189dc52fcbc 100755
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -424,26 +424,6 @@ LLFILE *	LLFile::_Fiopen(const std::string& filename,
 /************** llstdio file buffer ********************************/
 
 
-//llstdio_filebuf* llstdio_filebuf::open(const char *_Filename,
-//	ios_base::openmode _Mode)
-//{
-//#if LL_WINDOWS
-//	_Filet *_File;
-//	if (is_open() || (_File = LLFILE::_Fiopen(_Filename, _Mode)) == 0)
-//		return (0);	// open failed
-//
-//	_Init(_File, _Openfl);
-//	_Initcvt(&_USE(_Mysb::getloc(), _Cvt));
-//	return (this);	// open succeeded
-//#else
-//	std::filebuf* _file = std::filebuf::open(_Filename, _Mode);
-//	if (NULL == _file) return NULL;
-//	return this;
-//#endif
-//}
-
-
-// *TODO: Seek the underlying c stream for better cross-platform compatibility?
 #if !LL_WINDOWS
 llstdio_filebuf::int_type llstdio_filebuf::overflow(llstdio_filebuf::int_type __c)
 {
@@ -865,3 +845,153 @@ int llstdio_filebuf::sync()
 }
 #endif
 
+#if LL_WINDOWS
+/************** input file stream ********************************/
+
+llifstream::llifstream() :
+    _M_filebuf(),
+	std::istream(&_M_filebuf)
+{
+}
+
+// explicit
+llifstream::llifstream(const std::string& _Filename, 
+                       ios_base::openmode _Mode) :
+    _M_filebuf(),
+	std::istream(&_M_filebuf)
+{
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open(wideName.c_str(), _Mode | ios_base::in) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+// explicit
+llifstream::llifstream(const char* _Filename, 
+                       ios_base::openmode _Mode) :
+    _M_filebuf(),
+	std::istream(&_M_filebuf)
+{
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open(wideName.c_str(), _Mode | ios_base::in) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+bool llifstream::is_open() const
+{	// test if C stream has been opened
+	return _M_filebuf.is_open();
+}
+
+void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
+{	// open a C stream with specified mode
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::in) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+	else
+	{
+		_Myios::clear();
+	}
+}
+
+void llifstream::close()
+{	// close the C stream
+	if (_M_filebuf.close() == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+
+/************** output file stream ********************************/
+
+
+llofstream::llofstream() :
+    _M_filebuf(),
+	std::ostream(&_M_filebuf)
+{
+}
+
+// explicit
+llofstream::llofstream(const std::string& _Filename,
+                       ios_base::openmode _Mode) :
+    _M_filebuf(),
+	std::ostream(&_M_filebuf)
+{
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+// explicit
+llofstream::llofstream(const char* _Filename,
+                       ios_base::openmode _Mode) :
+    _M_filebuf(),
+	std::ostream(&_M_filebuf)
+{
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+bool llofstream::is_open() const
+{	// test if C stream has been opened
+	return _M_filebuf.is_open();
+}
+
+void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
+{	// open a C stream with specified mode
+	llutf16string wideName = utf8str_to_utf16str( _Filename );
+	if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+	else
+	{
+		_Myios::clear();
+	}
+}
+
+void llofstream::close()
+{	// close the C stream
+	if (_M_filebuf.close() == 0)
+	{
+		_Myios::setstate(ios_base::failbit);
+	}
+}
+
+/************** helper functions ********************************/
+
+std::streamsize llifstream_size(llifstream& ifstr)
+{
+	if(!ifstr.is_open()) return 0;
+	std::streampos pos_old = ifstr.tellg();
+	ifstr.seekg(0, ios_base::beg);
+	std::streampos pos_beg = ifstr.tellg();
+	ifstr.seekg(0, ios_base::end);
+	std::streampos pos_end = ifstr.tellg();
+	ifstr.seekg(pos_old, ios_base::beg);
+	return pos_end - pos_beg;
+}
+
+std::streamsize llofstream_size(llofstream& ofstr)
+{
+	if(!ofstr.is_open()) return 0;
+	std::streampos pos_old = ofstr.tellp();
+	ofstr.seekp(0, ios_base::beg);
+	std::streampos pos_beg = ofstr.tellp();
+	ofstr.seekp(0, ios_base::end);
+	std::streampos pos_end = ofstr.tellp();
+	ofstr.seekp(pos_old, ios_base::beg);
+	return pos_end - pos_beg;
+}
+
+#endif  // LL_WINDOWS
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index e310d47325380e81f4dcbd7fd2876880fe94447d..347c9867aa6f5633fb4d961e560d7e72e37fd3b1 100755
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -192,4 +192,195 @@ class LL_COMMON_API llstdio_filebuf : public _Myfb
 #endif
 };
 
+#if LL_WINDOWS
+/**
+ *  @brief  Controlling input for files.
+ *
+ *  This class supports reading from named files, using the inherited
+ *  functions from std::basic_istream.  To control the associated
+ *  sequence, an instance of std::basic_filebuf (or a platform-specific derivative)
+ *  which allows construction using a pre-exisintg file stream buffer. 
+ *  We refer to this std::basic_filebuf (or derivative) as @c sb.
+ */
+class LL_COMMON_API llifstream	:	public	std::istream
+{
+	// input stream associated with a C stream
+  public:
+	// Constructors:
+	/**
+	 *  @brief  Default constructor.
+	 *
+	 *  Initializes @c sb using its default constructor, and passes
+	 *  @c &sb to the base class initializer.  Does not open any files
+	 *  (you haven't given it a filename to open).
+     */
+	llifstream();
+
+	/**
+	 *  @brief  Create an input file stream.
+	 *  @param  Filename  String specifying the filename.
+	 *  @param  Mode  Open file in specified mode (see std::ios_base).
+	 *
+     *  @c ios_base::in is automatically included in @a mode.
+     */
+	explicit llifstream(const std::string& _Filename,
+                        ios_base::openmode _Mode = ios_base::in);
+	explicit llifstream(const char* _Filename,
+                        ios_base::openmode _Mode = ios_base::in);
+
+	/**
+	 *  @brief  The destructor does nothing.
+	 *
+	 *  The file is closed by the filebuf object, not the formatting
+	 *  stream.
+     */
+	virtual ~llifstream() {}
+
+	// Members:
+	/**
+	 *  @brief  Accessing the underlying buffer.
+	 *  @return  The current basic_filebuf buffer.
+	 *
+	 *  This hides both signatures of std::basic_ios::rdbuf().
+	*/
+	llstdio_filebuf* rdbuf() const
+	{ return const_cast<llstdio_filebuf*>(&_M_filebuf); }
+
+	/**
+	 *  @brief  Wrapper to test for an open file.
+	 *  @return  @c rdbuf()->is_open()
+     */
+	bool is_open() const;
+
+	/**
+	 *  @brief  Opens an external file.
+	 *  @param  Filename  The name of the file.
+	 *  @param  Node  The open mode flags.
+	 *
+	 *  Calls @c llstdio_filebuf::open(s,mode|in).  If that function
+	 *  fails, @c failbit is set in the stream's error state.
+     */
+	void open(const std::string& _Filename,
+              ios_base::openmode _Mode = ios_base::in)
+	{ open(_Filename.c_str(), _Mode); }
+	void open(const char* _Filename,
+              ios_base::openmode _Mode = ios_base::in);
+
+	/**
+	 *  @brief  Close the file.
+	 *
+	 *  Calls @c llstdio_filebuf::close().  If that function
+	 *  fails, @c failbit is set in the stream's error state.
+     */
+	void close();
+
+  private:
+	llstdio_filebuf _M_filebuf;
+};
+
+
+/**
+ *  @brief  Controlling output for files.
+ *
+ *  This class supports writing to named files, using the inherited
+ *  functions from std::basic_ostream.  To control the associated
+ *  sequence, an instance of std::basic_filebuf (or a platform-specific derivative)
+ *  which allows construction using a pre-exisintg file stream buffer. 
+ *  We refer to this std::basic_filebuf (or derivative) as @c sb.
+*/
+class LL_COMMON_API llofstream	:	public	std::ostream
+{
+  public:
+	// Constructors:
+	/**
+	 *  @brief  Default constructor.
+	 *
+	 *  Initializes @c sb using its default constructor, and passes
+	 *  @c &sb to the base class initializer.  Does not open any files
+	 *  (you haven't given it a filename to open).
+     */
+	llofstream();
+
+	/**
+	 *  @brief  Create an output file stream.
+	 *  @param  Filename  String specifying the filename.
+	 *  @param  Mode  Open file in specified mode (see std::ios_base).
+	 *
+	 *  @c ios_base::out|ios_base::trunc is automatically included in
+	 *  @a mode.
+     */
+	explicit llofstream(const std::string& _Filename,
+                        ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
+	explicit llofstream(const char* _Filename,
+                        ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
+
+	/**
+	 *  @brief  The destructor does nothing.
+	 *
+	 *  The file is closed by the filebuf object, not the formatting
+	 *  stream.
+	*/
+	virtual ~llofstream() {}
+
+	// Members:
+	/**
+	 *  @brief  Accessing the underlying buffer.
+	 *  @return  The current basic_filebuf buffer.
+	 *
+	 *  This hides both signatures of std::basic_ios::rdbuf().
+	*/
+	llstdio_filebuf* rdbuf() const
+	{ return const_cast<llstdio_filebuf*>(&_M_filebuf); }
+
+	/**
+	 *  @brief  Wrapper to test for an open file.
+	 *  @return  @c rdbuf()->is_open()
+	*/
+	bool is_open() const;
+
+	/**
+	 *  @brief  Opens an external file.
+	 *  @param  Filename  The name of the file.
+	 *  @param  Node  The open mode flags.
+	 *
+	 *  Calls @c llstdio_filebuf::open(s,mode|out).  If that function
+	 *  fails, @c failbit is set in the stream's error state.
+     */
+	void open(const std::string& _Filename,
+              ios_base::openmode _Mode = ios_base::out|ios_base::trunc)
+	{ open(_Filename.c_str(), _Mode); }
+	void open(const char* _Filename,
+              ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
+
+	/**
+	 *  @brief  Close the file.
+	 *
+	 *  Calls @c llstdio_filebuf::close().  If that function
+	 *  fails, @c failbit is set in the stream's error state.
+     */
+	void close();
+
+  private:
+	llstdio_filebuf _M_filebuf;
+};
+
+
+/**
+ * @breif filesize helpers.
+ *
+ * The file size helpers are not considered particularly efficient,
+ * and should only be used for config files and the like -- not in a
+ * loop.
+ */
+std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr);
+std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr);
+
+#else // ! LL_WINDOWS
+
+// on non-windows, llifstream and llofstream are just mapped directly to the std:: equivalents
+typedef std::ifstream llifstream;
+typedef std::ofstream llofstream;
+
+#endif // LL_WINDOWS or ! LL_WINDOWS
+
 #endif // not LL_LLFILE_H
diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp
index f95519400912ae9dcf03093358e891b2e4affca7..a9b1cdf4f641cfb9fdff930b5ed1b601cadaa792 100755
--- a/indra/llcommon/llliveappconfig.cpp
+++ b/indra/llcommon/llliveappconfig.cpp
@@ -49,7 +49,7 @@ bool LLLiveAppConfig::loadFile()
 {
 	LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from "
 		<< filename() << LL_ENDL;
-    std::ifstream file(filename().c_str());
+    llifstream file(filename().c_str());
 	LLSD config;
     if (file.is_open())
     {
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 227f81e88fb25f256121fd425af2f5d08a6b96d6..f3b8999883ab2d1892ee769fe66ca2b6409a4419 100755
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -107,7 +107,7 @@ bool iswindividual(llwchar elem)
 
 bool _read_file_into_string(std::string& str, const std::string& filename)
 {
-	std::ifstream ifs(filename.c_str(), std::ifstream::binary);
+	llifstream ifs(filename.c_str(), llifstream::binary);
 	if (!ifs.is_open())
 	{
 		LL_INFOS() << "Unable to open file " << filename << LL_ENDL;
diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp
index 049aa4d1353d02cb583d94573d0a34e13016c88d..7dde1fcd69fbd1a0b2617ad38e73077aaf416142 100644
--- a/indra/llcrashlogger/llcrashlock.cpp
+++ b/indra/llcrashlogger/llcrashlock.cpp
@@ -106,7 +106,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
 {
 	LLSD lock_sd = LLSD::emptyMap();
     
-	std::ifstream ifile(filename.c_str());
+	llifstream ifile(filename.c_str());
     
 	if (ifile.is_open())
 	{									            
@@ -120,7 +120,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
 bool LLCrashLock::putLockFile(std::string filename, const LLSD& data)
 {    
     bool result = true;
-    std::ofstream ofile(filename.c_str());
+    llofstream ofile(filename.c_str());
     
 	if (!LLSDSerialize::toXML(data,ofile))
 	{
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index ef92395d6dbda483f4d4d414333240c94d43d638..16df27bb8e17df9ab072e41d51c2ccb5a62ae777 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1172,7 +1172,7 @@ static std::string find_file(std::string &name, S8 *codec)
 	for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++)
 	{
 		tname = name + "." + std::string(file_extensions[i].exten);
-		std::ifstream ifs(tname.c_str(), std::ifstream::binary);
+		llifstream ifs(tname.c_str(), llifstream::binary);
 		if (ifs.is_open())
 		{
 			ifs.close();
@@ -1219,7 +1219,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
 		return false; // format not recognized
 	}
 
-	std::ifstream ifs(name.c_str(), std::ifstream::binary);
+	llifstream ifs(name.c_str(), llifstream::binary);
 	if (!ifs.is_open())
 	{
 		// SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 92fbc8ad731b3af12c6700bd981edfcefae6efde..41adc7be9a10e3bbcc90812d09860ae05bc195f5 100755
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -54,7 +54,7 @@ LLImageFilter::LLImageFilter(const std::string& file_path) :
     mStencilMax(1.0)
 {
     // Load filter description from file
-	std::ifstream filter_xml(file_path.c_str());
+	llifstream filter_xml(file_path.c_str());
 	if (filter_xml.is_open())
 	{
 		// Load and parse the file
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 9a1aeca3cb18d624684d651384ba61411456a0ea..11647c5518587d0fd841c0e32bc3284a7bc5bb39 100755
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -229,7 +229,7 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
 }
 
 // exportFile should be replaced with exportLegacyStream
-// not sure whether exportLegacyStream(std::ofstream(fp)) would work, fp may need to get icramented...
+// not sure whether exportLegacyStream(llofstream(fp)) would work, fp may need to get icramented...
 BOOL LLInventoryObject::exportFile(LLFILE* fp, BOOL) const
 {
 	std::string uuid_str;
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index a36b3ff3c8824d87b1cb6eb1aa1257088bcd95ca..f8db3dded2b711bec718a639f0d5c6beedfa0791 100755
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -157,7 +157,7 @@ namespace
 		{
 			LLBufferStream ostream(channels, buffer.get());
 
-			std::ifstream fstream(mFilename.c_str(), std::iostream::binary | std::iostream::out);
+			llifstream fstream(mFilename.c_str(), std::iostream::binary | std::iostream::out);
 			if(fstream.is_open())
 			{
 				fstream.seekg(0, std::ios::end);
diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp
index e91051b73eb97647cbdf4f3717f6eaa3d1f8b310..64e79d67675530152a9f8a357b64e0e6e6eaf5a1 100755
--- a/indra/llmessage/llmessageconfig.cpp
+++ b/indra/llmessage/llmessageconfig.cpp
@@ -96,7 +96,7 @@ bool LLMessageConfigFile::loadFile()
 {
 	LLSD data;
     {
-        std::ifstream file(filename().c_str());
+        llifstream file(filename().c_str());
         
         if (file.is_open())
         {
diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp
index 34ab891830858ffb688425e7e6624854a7bd785e..cf2e42f95cdaf300c034f2505bbad61226f1e50d 100755
--- a/indra/llmessage/llservicebuilder.cpp
+++ b/indra/llmessage/llservicebuilder.cpp
@@ -34,7 +34,7 @@
 void LLServiceBuilder::loadServiceDefinitionsFromFile(
 	const std::string& service_filename)
 {
-	std::ifstream service_file(service_filename.c_str(), std::ios::binary);
+	llifstream service_file(service_filename.c_str(), std::ios::binary);
 	if(service_file.is_open())
 	{
 		LLSD service_data;
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index 7f0c9e9533fbf8bc93f4a3536d4e8b26c4a831e6..b6ea5aa7f12a4f61e066d3e2ccdd1948b036f888 100755
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -66,7 +66,7 @@ LLPostProcess::LLPostProcess(void) :
 	std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
 	LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
 
-	std::ifstream effectsXML(pathName);
+	llifstream effectsXML(pathName);
 
 	if (effectsXML)
 	{
@@ -153,7 +153,7 @@ void LLPostProcess::saveEffect(std::string const & effectName)
 	std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
 	//LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL;
 
-	std::ofstream effectsXML(pathName);
+	llofstream effectsXML(pathName);
 
 	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
 
diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp
index e6551a84c346bb182bd211318866527ef0653127..0db428105907ef1d331a56b08513b2416a7724eb 100755
--- a/indra/llui/llspellcheck.cpp
+++ b/indra/llui/llspellcheck.cpp
@@ -145,13 +145,13 @@ void LLSpellChecker::refreshDictionaryMap()
 
 	// Load dictionary information (file name, friendly name, ...)
     std::string user_filename(user_path + DICT_FILE_MAIN);
-	std::ifstream user_file(user_filename.c_str(), std::ios::binary);
+	llifstream user_file(user_filename.c_str(), std::ios::binary);
 	if ( (!user_file.is_open()) 
 		|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file)) 
 		|| (0 == sDictMap.size()) )
 	{
         std::string app_filename(app_path + DICT_FILE_MAIN);
-		std::ifstream app_file(app_filename.c_str(), std::ios::binary);
+		llifstream app_file(app_filename.c_str(), std::ios::binary);
 		if ( (!app_file.is_open()) 
 			|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file)) 
 			|| (0 == sDictMap.size()) )
@@ -161,7 +161,7 @@ void LLSpellChecker::refreshDictionaryMap()
 	}
 
 	// Load user installed dictionary information
-	std::ifstream custom_file(user_filename.c_str(), std::ios::binary);
+	llifstream custom_file(user_filename.c_str(), std::ios::binary);
 	if (custom_file.is_open())
 	{
 		LLSD custom_dict_map;
@@ -217,7 +217,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
 
 	if (gDirUtilp->fileExists(dict_path))
 	{
-		std::ifstream file_in(dict_path.c_str(), std::ios::in);
+		llifstream file_in(dict_path.c_str(), std::ios::in);
 		if (file_in.is_open())
 		{
 			std::string word; int line_num = 0;
@@ -240,7 +240,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
 
 	word_list.push_back(word);
 
-	std::ofstream file_out(dict_path.c_str(), std::ios::out | std::ios::trunc);	
+	llofstream file_out(dict_path.c_str(), std::ios::out | std::ios::trunc);	
 	if (file_out.is_open())
 	{
 		file_out << word_list.size() << std::endl;
@@ -354,7 +354,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language)
 
 		if (gDirUtilp->fileExists(user_path + DICT_FILE_IGNORE))
 		{
-			std::ifstream file_in((user_path + DICT_FILE_IGNORE).c_str(), std::ios::in);
+			llifstream file_in((user_path + DICT_FILE_IGNORE).c_str(), std::ios::in);
 			if (file_in.is_open())
 			{
 				std::string word; int idxLine = 0;
@@ -466,7 +466,7 @@ LLSD LLSpellChecker::loadUserDictionaryMap()
 {
 	LLSD dict_map;
     std::string dict_filename(getDictionaryUserPath() + DICT_FILE_USER);
-	std::ifstream dict_file(dict_filename.c_str(), std::ios::binary);
+	llifstream dict_file(dict_filename.c_str(), std::ios::binary);
 	if (dict_file.is_open())
 	{
 		LLSDSerialize::fromXMLDocument(dict_map, dict_file);
@@ -478,7 +478,7 @@ LLSD LLSpellChecker::loadUserDictionaryMap()
 // static
 void LLSpellChecker::saveUserDictionaryMap(const LLSD& dict_map)
 {
-	std::ofstream dict_file((getDictionaryUserPath() + DICT_FILE_USER).c_str(), std::ios::trunc);
+	llofstream dict_file((getDictionaryUserPath() + DICT_FILE_USER).c_str(), std::ios::trunc);
 	if (dict_file.is_open())
 	{
 		LLSDSerialize::toPrettyXML(dict_map, dict_file);
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index 086d937753b3f3490e38af25eabffe9119e58a3b..0b36241da0775d7ffca17ab0b869a00598bc9def 100755
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -211,7 +211,7 @@ void LLTextParser::loadKeywords()
 	std::string filename=getFileName();
 	if (!filename.empty())
 	{
-		std::ifstream file;
+		llifstream file;
 		file.open(filename.c_str());
 		if (file.is_open())
 		{
@@ -231,7 +231,7 @@ bool LLTextParser::saveToDisk(LLSD highlights)
 		LL_WARNS() << "LLTextParser::saveToDisk() no valid user directory." << LL_ENDL; 
 		return FALSE;
 	}	
-	std::ofstream file;
+	llofstream file;
 	file.open(filename.c_str());
 	LLSDSerialize::toPrettyXML(mHighlights, file);
 	file.close();
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index fb00572817ac0d197bbae898f6043182c838087f..375efcc3de870ab83ca2c8590fa651dafdebc18d 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -79,7 +79,7 @@ class LLViewerEventRecorder : public LLSingleton<LLViewerEventRecorder>
   bool logEvents;
 
   std::string mLogFilename;
-  std::ofstream  mLog; 
+  llofstream  mLog; 
 
 
  private:
diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp
index 26cbce1028ad1bb35607c0ec728c4bca7208b1bf..6572edead398f250e6ac45308dc9a3ed3ee8399b 100644
--- a/indra/llvfs/llpidlock.cpp
+++ b/indra/llvfs/llpidlock.cpp
@@ -95,7 +95,7 @@ LLPidLockFile& LLPidLockFile::instance()
 
 void LLPidLockFile::writeLockFile(LLSD pids)
 {
-	std::ofstream ofile(mLockName.c_str());
+	llofstream ofile(mLockName.c_str());
 
 	if (!LLSDSerialize::toXML(pids,ofile))
 	{
@@ -119,7 +119,7 @@ bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave,
 	LLSD out_pids;
 	out_pids.append( (LLSD::Integer)mPID );
 
-	std::ifstream ifile(mLockName.c_str());
+	llifstream ifile(mLockName.c_str());
 
 	if (ifile.is_open()) 
 	{									//If file exists, we need to decide whether or not to continue.
@@ -175,7 +175,7 @@ bool LLPidLockFile::checkLock()
 
 void LLPidLockFile::releaseLock()
 {
-	std::ifstream ifile(mLockName.c_str());
+	llifstream ifile(mLockName.c_str());
 	LLSD in_pids;
 	LLSD out_pids;
 	bool write_file=FALSE;
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 079545d31f4bedbd6ea61e356bb335008882e415..4e3d0ab39276aa251d2bf2f73b03029db12aea2d 100755
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -832,7 +832,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
 			++num_saved;
 		}
 	}
-	std::ofstream file;
+	llofstream file;
 	file.open(filename.c_str());
 	if (file.is_open())
 	{
@@ -852,7 +852,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
 U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_values, bool save_values)
 {
 	LLSD settings;
-	std::ifstream infile;
+	llifstream infile;
 	infile.open(filename.c_str());
 	if(!infile.is_open())
 	{
diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp
index bc17a88f7ce2f4e231dc2b6527580f8b7c2b49c6..2b691ffbb1a8ba63503b6adec0ef9a0733e96c34 100755
--- a/indra/llxml/tests/llcontrol_test.cpp
+++ b/indra/llxml/tests/llcontrol_test.cpp
@@ -80,7 +80,7 @@ namespace tut
 		}
 		void writeSettingsFile(const LLSD& config)
 		{
-			std::ofstream file(mTestConfigFile.c_str());
+			llofstream file(mTestConfigFile.c_str());
 			if (file.is_open())
 			{
 				LLSDSerialize::toPrettyXML(config, file);
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
index 4b3b0e42e02b0e15f2c1c69d222ebc5ae1ce0b47..cfc445f9986fea6d3f9c72084fc931507318c336 100755
--- a/indra/newview/llagentpilot.cpp
+++ b/indra/newview/llagentpilot.cpp
@@ -84,7 +84,7 @@ void LLAgentPilot::loadTxt(const std::string& filename)
 		return;
 	}
 	
-	std::ifstream file(filename.c_str());
+	llifstream file(filename.c_str());
 
 	if (!file)
 	{
@@ -125,7 +125,7 @@ void LLAgentPilot::loadXML(const std::string& filename)
 		return;
 	}
 	
-	std::ifstream file(filename.c_str());
+	llifstream file(filename.c_str());
 
 	if (!file)
 	{
@@ -167,7 +167,7 @@ void LLAgentPilot::save()
 
 void LLAgentPilot::saveTxt(const std::string& filename)
 {
-	std::ofstream file;
+	llofstream file;
 	file.open(filename.c_str());
 
 	if (!file)
@@ -190,7 +190,7 @@ void LLAgentPilot::saveTxt(const std::string& filename)
 
 void LLAgentPilot::saveXML(const std::string& filename)
 {
-	std::ofstream file;
+	llofstream file;
 	file.open(filename.c_str());
 
 	if (!file)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b2c74854ffcd1df605f3fe2a94007a61eeac4938..9668da252281a844efacd701944ef499cc8c925c 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3273,7 +3273,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
         : getDynamicDebugFile() );
     
 	LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL;
-	std::ofstream out_file(debug_filename->c_str());
+	llofstream out_file(debug_filename->c_str());
     
     isStatic ?  LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
              :  LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
@@ -3762,7 +3762,7 @@ void LLAppViewer::handleViewerCrash()
 	{
 		std::string filename;
 		filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log");
-		std::ofstream file(filename.c_str(), std::ios_base::binary);
+		llofstream file(filename.c_str(), std::ios_base::binary);
 		if(file.good())
 		{
 			LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL;
@@ -4650,7 +4650,7 @@ void LLAppViewer::loadNameCache()
 	std::string filename =
 		gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
 	LL_INFOS("AvNameCache") << filename << LL_ENDL;
-	std::ifstream name_cache_stream(filename.c_str());
+	llifstream name_cache_stream(filename.c_str());
 	if(name_cache_stream.is_open())
 	{
 		if ( ! LLAvatarNameCache::importFile(name_cache_stream))
@@ -4665,7 +4665,7 @@ void LLAppViewer::loadNameCache()
 
 	std::string name_cache;
 	name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
-	std::ifstream cache_file(name_cache.c_str());
+	llifstream cache_file(name_cache.c_str());
 	if(cache_file.is_open())
 	{
 		if(gCacheName->importFile(cache_file)) return;
@@ -4677,7 +4677,7 @@ void LLAppViewer::saveNameCache()
 	// display names cache
 	std::string filename =
 		gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
-	std::ofstream name_cache_stream(filename.c_str());
+	llofstream name_cache_stream(filename.c_str());
 	if(name_cache_stream.is_open())
 	{
 		LLAvatarNameCache::exportFile(name_cache_stream);
@@ -4688,7 +4688,7 @@ void LLAppViewer::saveNameCache()
     {
         std::string name_cache;
         name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
-        std::ofstream cache_file(name_cache.c_str());
+        llofstream cache_file(name_cache.c_str());
         if(cache_file.is_open())
         {
             gCacheName->exportFile(cache_file);
diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp
index 62e32eac0044a2e46cd26e047f1ff5b069595b56..dd9354fe3a8b7d8f31a62ef83024a2fab509fafd 100755
--- a/indra/newview/llautoreplace.cpp
+++ b/indra/newview/llautoreplace.cpp
@@ -148,7 +148,7 @@ void LLAutoReplace::loadFromSettings()
 	if(gDirUtilp->fileExists(filename))
 	{
 		LLSD userSettings;
-		std::ifstream file;
+		llifstream file;
 		file.open(filename.c_str());
 		if (file.is_open())
 		{
@@ -173,7 +173,7 @@ void LLAutoReplace::loadFromSettings()
 		if(gDirUtilp->fileExists(defaultName))
 		{
 			LLSD appDefault;
-			std::ifstream file;
+			llifstream file;
 			file.open(defaultName.c_str());
 			if (file.is_open())
 			{
@@ -209,7 +209,7 @@ void LLAutoReplace::loadFromSettings()
 void LLAutoReplace::saveToUserSettings()
 {
 	std::string filename=getUserSettingsFileName();
-	std::ofstream file;
+	llofstream file;
 	file.open(filename.c_str());
 	LLSDSerialize::toPrettyXML(mSettings.asLLSD(), file);
 	file.close();
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index fd96e65edd99abc0fbb95948124a5713013f2d6b..281e591b4889ef9e68c7ce4e5671bba161164219 100755
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -76,7 +76,7 @@ void LLAvatarIconIDCache::load	()
 	
 	// build filename for each user
 	std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename);
-	std::ifstream file(resolved_filename.c_str());
+	llifstream file(resolved_filename.c_str());
 
 	if (!file.is_open())
 		return;
@@ -114,7 +114,7 @@ void LLAvatarIconIDCache::save	()
 	std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename);
 
 	// open a file for writing
-	std::ofstream file (resolved_filename.c_str());
+	llofstream file (resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't open avatar icons cache file\"" << mFilename << "\" for writing" << LL_ENDL;
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp
index 9d4f7f6dd8f4ee6d6415403777b355f27b779a1a..1819fc74ee1ae6c30c614e457e635f75d7e92c2c 100755
--- a/indra/newview/llcommandlineparser.cpp
+++ b/indra/newview/llcommandlineparser.cpp
@@ -621,7 +621,7 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG
     // members of a control group.
     LLSD clpConfigLLSD;
     
-    std::ifstream input_stream;
+    llifstream input_stream;
     input_stream.open(config_filename.c_str(), std::ios::in | std::ios::binary);
 
     if(input_stream.is_open())
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4c8a4ece70e6a837c3c705d7c105bb625205124a..fc9e85caf814bbfec1c047df9e98fa01942fb6a4 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1469,7 +1469,7 @@ void LLFavoritesOrderStorage::destroyClass()
 
 
 	std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
-	std::ifstream file;
+	llifstream file;
 	file.open(old_filename.c_str());
 	if (file.is_open())
 	{
@@ -1507,7 +1507,7 @@ void LLFavoritesOrderStorage::load()
 	std::string filename = getSavedOrderFileName();
 
 	LLSD settings_llsd;
-	std::ifstream file;
+	llifstream file;
 	file.open(filename.c_str());
 	if (file.is_open())
 	{
@@ -1541,7 +1541,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
 	std::string filename = getStoredFavoritesFilename();
     if (!filename.empty())
     {
-        std::ifstream in_file;
+        llifstream in_file;
         in_file.open(filename.c_str());
         LLSD fav_llsd;
         if (in_file.is_open())
@@ -1588,7 +1588,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
         // as we'll compare it with the stored credentials in the login panel.
         fav_llsd[av_name.getUserName()] = user_llsd;
 
-        std::ofstream file;
+        llofstream file;
         file.open(filename.c_str());
         if ( file.is_open() )
         {
@@ -1613,7 +1613,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
     if (!filename.empty())
     {
         LLSD fav_llsd;
-        std::ifstream file;
+        llifstream file;
         file.open(filename.c_str());
         if (file.is_open())
         {
@@ -1630,7 +1630,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
                 fav_llsd.erase(av_name.getUserName());
             }
         
-            std::ofstream out_file;
+            llofstream out_file;
             out_file.open(filename.c_str());
             if ( out_file.is_open() )
             {
@@ -1686,7 +1686,7 @@ void LLFavoritesOrderStorage::save()
                 settings_llsd[iter->first.asString()] = iter->second;
             }
 
-            std::ofstream file;
+            llofstream file;
             file.open(filename.c_str());
             if ( file.is_open() )
             {
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 12afb552eb423c78446184c84fa5a10b032586b7..ea39f812fd14cffa71991b0ae53b123227a6f0bf 100755
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -326,7 +326,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename)
 {
 	LL_INFOS("RenderInit") << "Attempting to parse feature table from " << filename << LL_ENDL;
 
-	std::ifstream file;
+	llifstream file;
 	std::string name;
 	U32		version;
 	
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 5529111b7ff33c1b87f51cb6ee9f879a4de2bb66..b342d8fdf36ef8dd6aa8df30146e57af4d204b29 100755
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -154,7 +154,7 @@ BOOL LLFloaterAbout::postBuild()
 
 	// Get the names of contributors, extracted from .../doc/contributions.txt by viewer_manifest.py at build time
 	std::string contributors_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"contributors.txt");
-	std::ifstream contrib_file;
+	llifstream contrib_file;
 	std::string contributors;
 	contrib_file.open(contributors_path.c_str());		/* Flawfinder: ignore */
 	if (contrib_file.is_open())
@@ -172,7 +172,7 @@ BOOL LLFloaterAbout::postBuild()
 
     // Get the Versions and Copyrights, created at build time
 	std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt");
-	std::ifstream licenses_file;
+	llifstream licenses_file;
 	licenses_file.open(licenses_path.c_str());		/* Flawfinder: ignore */
 	if (licenses_file.is_open())
 	{
diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp
index a16ecf2a80b802858d2302f5cef66cf0f2cae0ff..6e56e929df606d194bd889db9b4b91c1422b4ebd 100755
--- a/indra/newview/llfloaterautoreplacesettings.cpp
+++ b/indra/newview/llfloaterautoreplacesettings.cpp
@@ -353,7 +353,7 @@ void LLFloaterAutoReplaceSettings::onImportList()
 	LLFilePicker& picker = LLFilePicker::instance();
 	if( picker.getOpenFile( LLFilePicker::FFLOAD_XML) )
 	{
-		std::ifstream file;
+		llifstream file;
 		file.open(picker.getFirstFile().c_str());
 		LLSD newList;
 		if (file.is_open())
@@ -545,7 +545,7 @@ void LLFloaterAutoReplaceSettings::onExportList()
 	LLFilePicker& picker = LLFilePicker::instance();
 	if( picker.getSaveFile( LLFilePicker::FFSAVE_XML, listFileName) )
 	{
-		std::ofstream file;
+		llofstream file;
 		file.open(picker.getFirstFile().c_str());
 		LLSDSerialize::toPrettyXML(*list, file);
 		file.close();
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index e3ca48e4aeb87e58b9ad3dba72cc271d66ad38ba..b9113d265ae9ec24aed23ce1f6f60c5a8bdd69c3 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2155,7 +2155,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
 
 	S32 file_size = (S32) stat.st_size;
 	
-	std::ifstream ifstream(filename.c_str(), std::ifstream::in | std::ifstream::binary);
+	llifstream ifstream(filename.c_str(), std::ifstream::in | std::ifstream::binary);
 	LLSD data;
 	LLSDSerialize::fromBinary(data, ifstream, file_size);
 	ifstream.close();
@@ -3513,7 +3513,7 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw
 		data["instance"][i] = instance.asLLSD();
 	}
 
-	std::ofstream out(filename.c_str(), std::ios_base::out | std::ios_base::binary);
+	llofstream out(filename.c_str(), std::ios_base::out | std::ios_base::binary);
 	LLSDSerialize::toBinary(data, out);
 	out.flush();
 	out.close();
diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp
index 63346f42ef81a4b80f89c521c984d7df788889bc..5124dae1479d8d3ba4c702620036b7d743581897 100755
--- a/indra/newview/llfloaterspellchecksettings.cpp
+++ b/indra/newview/llfloaterspellchecksettings.cpp
@@ -351,7 +351,7 @@ void LLFloaterSpellCheckerImport::onBtnOK()
 
 		LLSD custom_dict_map;
         std::string custom_filename(LLSpellChecker::getDictionaryUserPath() + "user_dictionaries.xml");
-		std::ifstream custom_file_in(custom_filename.c_str());
+		llifstream custom_file_in(custom_filename.c_str());
 		if (custom_file_in.is_open())
 		{
 			LLSDSerialize::fromXMLDocument(custom_dict_map, custom_file_in);
@@ -373,7 +373,7 @@ void LLFloaterSpellCheckerImport::onBtnOK()
 			custom_dict_map.append(custom_dict_info);
 		}
 
-		std::ofstream custom_file_out(custom_filename.c_str(), std::ios::trunc);
+		llofstream custom_file_out(custom_filename.c_str(), std::ios::trunc);
 		if (custom_file_out.is_open())
 		{
 			LLSDSerialize::toPrettyXML(custom_dict_map, custom_file_out);
diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp
index 57f53bd0d91cd13331b29b8fc53825d27a84c722..162d6e003e94a7bbf5dfb9441b0ae54863802bda 100755
--- a/indra/newview/lllocationhistory.cpp
+++ b/indra/newview/lllocationhistory.cpp
@@ -127,7 +127,7 @@ void LLLocationHistory::save() const
 	}
 
 	// open a file for writing
-	std::ofstream file(resolved_filename.c_str());
+	llofstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't open location history file \"" << mFilename << "\" for writing" << LL_ENDL;
@@ -148,7 +148,7 @@ void LLLocationHistory::load()
 	
 	// build filename for each user
 	std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename);
-	std::ifstream file(resolved_filename.c_str());
+	llifstream file(resolved_filename.c_str());
 
 	if (!file.is_open())
 	{
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 8585fa6078890b4d7897731980f705c2912cdb38..7ddacf3033715476d95d2acb36e6b2ff17a524c5 100755
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -302,7 +302,7 @@ void LLLogChat::saveHistory(const std::string& filename,
 		return;
 	}
 	
-	std::ofstream file(LLLogChat::makeLogFileName(filename).c_str(), std::ios_base::app);
+	llofstream file(LLLogChat::makeLogFileName(filename).c_str(), std::ios_base::app);
 	if (!file.is_open())
 	{
 		LL_WARNS() << "Couldn't open chat history log! - " + filename << LL_ENDL;
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index 315084788e9c510eafcd6f3065f124bdca4b6c1d..3418b33d377897bbe88faca093017a802c6d5082 100755
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -87,7 +87,7 @@ LLNotificationStorage::~LLNotificationStorage()
 bool LLNotificationStorage::writeNotifications(const LLSD& pNotificationData) const
 {
 
-	std::ofstream notifyFile(mFileName.c_str());
+	llofstream notifyFile(mFileName.c_str());
 	bool didFileOpen = notifyFile.is_open();
 
 	if (!didFileOpen)
@@ -113,7 +113,7 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_n
 
 	pNotificationData.clear();
 
-	std::ifstream notifyFile(filename.c_str());
+	llifstream notifyFile(filename.c_str());
 	didFileRead = notifyFile.is_open();
 	if (!didFileRead)
 	{
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 8b9cd9c88ac7286aa70f970b8a9b83e6b8df4913..cc8c3edd51a8435ca105b88235cedf94e40dab8d 100755
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -307,7 +307,7 @@ void LLPanelLogin::addFavoritesToStartLocation()
 	updateLoginButtons();
 
 	LLSD fav_llsd;
-	std::ifstream file;
+	llifstream file;
 	file.open(filename.c_str());
 	if (!file.is_open())
 	{
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 87f27ea8ef28ad782893feb73ec0211e3526448d..17c0b226d0c2401e8659244febe4a899f1a62a09 100755
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -162,7 +162,7 @@ BOOL LLPanelMainInventory::postBuild()
 	// Now load the stored settings from disk, if available.
 	std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME));
 	LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL;
-	std::ifstream file(filterSaveName.c_str());
+	llifstream file(filterSaveName.c_str());
 	LLSD savedFilterState;
 	if (file.is_open())
 	{
@@ -243,7 +243,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
 	}
 
 	std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME));
-	std::ofstream filtersFile(filterSaveName.c_str());
+	llofstream filtersFile(filterSaveName.c_str());
 	if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile))
 	{
 		LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL;
diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp
index 0bc88590da963156b802326e139022679139f2e5..0ea05a03d6775bf1aa6effa9eaf5c0f68c756dff 100755
--- a/indra/newview/llsearchhistory.cpp
+++ b/indra/newview/llsearchhistory.cpp
@@ -43,7 +43,7 @@ bool LLSearchHistory::load()
 {
 	// build filename for each user
 	std::string resolved_filename = getHistoryFilePath();
-	std::ifstream file(resolved_filename.c_str());
+	llifstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		return false;
@@ -76,7 +76,7 @@ bool LLSearchHistory::save()
 	// build filename for each user
 	std::string resolved_filename = getHistoryFilePath();
 	// open a file for writing
-	std::ofstream file(resolved_filename.c_str());
+	llofstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		return false;
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index c904b9566618b84fbc5c4069dda16880979debb8..40516f9bbb6243d0fe978f2a193b66f416135046 100755
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -640,7 +640,7 @@ LLBasicCertificateStore::~LLBasicCertificateStore()
 // persist the store
 void LLBasicCertificateStore::save()
 {
-	std::ofstream file_store(mFilename.c_str(), std::ios_base::binary);
+	llofstream file_store(mFilename.c_str(), std::ios_base::binary);
 	if(!file_store.fail())
 	{
 		for(iterator cert = begin();
@@ -1245,8 +1245,8 @@ void LLSecAPIBasicHandler::_readProtectedData()
 {	
 	// attempt to load the file into our map
 	LLPointer<LLSDParser> parser = new LLSDXMLParser();
-	std::ifstream protected_data_stream(mProtectedDataFilename.c_str(), 
-									std::ifstream::binary);
+	llifstream protected_data_stream(mProtectedDataFilename.c_str(), 
+									llifstream::binary);
 
 	if (!protected_data_stream.fail()) {
 		U8 salt[STORE_SALT_SIZE];
@@ -1330,7 +1330,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
 	// an error.
 	std::string tmp_filename = mProtectedDataFilename + ".tmp";
 	
-	std::ofstream protected_data_stream(tmp_filename.c_str(), 
+	llofstream protected_data_stream(tmp_filename.c_str(), 
                                      std::ios_base::binary);
 	try
 	{
@@ -1568,7 +1568,7 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword()
 {
 	const S32 HASHED_LENGTH = 32;	
 	std::vector<U8> buffer(HASHED_LENGTH);
-	std::ifstream password_file(mLegacyPasswordPath.c_str(), std::ifstream::binary);
+	llifstream password_file(mLegacyPasswordPath.c_str(), llifstream::binary);
 	
 	if(password_file.fail())
 	{
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
index cbbc238b24f4cc38afeedb8b273c71e84a67b4a9..802dff1ead9780710f3594cc36d4c56832f0f74b 100644
--- a/indra/newview/llsyntaxid.cpp
+++ b/indra/newview/llsyntaxid.cpp
@@ -83,7 +83,7 @@ class fetchKeywordsFileResponder : public LLHTTPClient::Responder
 		const std::string xml = str.str();
 
 		// save the str to disk, usually to the cache.
-		std::ofstream file(mFileSpec.c_str(), std::ios_base::out);
+		llofstream file(mFileSpec.c_str(), std::ios_base::out);
 		file.write(xml.c_str(), str.str().size());
 		file.close();
 
@@ -268,7 +268,7 @@ void LLSyntaxIdLSL::loadDefaultKeywordsIntoLLSD()
 void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
 {
 	LLSD content;
-	std::ifstream file;
+	llifstream file;
 	file.open(mFullFileSpec.c_str());
 	if (file.is_open())
 	{
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index 36257c8bf2b0e013187c148742dcc6d6c22e57b8..8a5704939a134f54c3ffda1aa2408f571a72c48f 100755
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -164,7 +164,7 @@ void LLTeleportHistoryStorage::save()
 	std::string resolvedFilename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename);
 
 	// open the history file for writing
-	std::ofstream file(resolvedFilename.c_str());
+	llofstream file(resolvedFilename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't open teleport history file \"" << mFilename << "\" for writing" << LL_ENDL;
@@ -186,7 +186,7 @@ void LLTeleportHistoryStorage::load()
 	std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename);
 
 	// open the history file for reading
-	std::ifstream file(resolved_filename.c_str());
+	llifstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't load teleport history from file \"" << mFilename << "\"" << LL_ENDL;
diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp
index d45891ec45b70b2d2ddb38c42126fd897111cd12..f7064e152ab9cb8386ba0b49d59784267faa96e1 100755
--- a/indra/newview/llurlhistory.cpp
+++ b/indra/newview/llurlhistory.cpp
@@ -46,7 +46,7 @@ bool LLURLHistory::loadFile(const std::string& filename)
 
     std::string user_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + filename);
 
-    std::ifstream file(user_filename.c_str());
+    llifstream file(user_filename.c_str());
     if (file.is_open())
     {
         LLSDSerialize::fromXML(data, file);
@@ -79,7 +79,7 @@ bool LLURLHistory::saveFile(const std::string& filename)
 	}
 
 	temp_str += gDirUtilp->getDirDelimiter() + filename;
-	std::ofstream out(temp_str.c_str());
+	llofstream out(temp_str.c_str());
 	if (!out.good())
 	{
 		LL_WARNS() << "Unable to open " << temp_str << " for output." << LL_ENDL;
diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp
index c401f862124ebf73e22f01b5f64540233114434d..3a7285974e4041381b069b8edce0453308c17461 100755
--- a/indra/newview/llurlwhitelist.cpp
+++ b/indra/newview/llurlwhitelist.cpp
@@ -87,7 +87,7 @@ bool LLUrlWhiteList::load ()
 	std::string resolvedFilename = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, mFilename );
 
 	// open a file for reading
-	std::ifstream file(resolvedFilename.c_str());
+	llifstream file(resolvedFilename.c_str());
 	if ( file.is_open () )
 	{
 		// add each line in the file to the list
@@ -122,7 +122,7 @@ bool LLUrlWhiteList::save ()
 	}
 
 	// open a file for writing
-	std::ofstream file(resolvedFilename.c_str());
+	llofstream file(resolvedFilename.c_str());
 	if ( file.is_open () )
 	{
 		// for each entry we have
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 69b1ee93dc2009af00e4b177e87912c62bf7a590..509227c6835f9f99be7cc7e9de3092df46440003 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1278,7 +1278,7 @@ void LLViewerMedia::loadCookieFile()
 	}
 	
 	// open the file for reading
-	std::ifstream file(resolved_filename.c_str());
+	llifstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't load plugin cookies from file \"" << PLUGIN_COOKIE_FILE_NAME << "\"" << LL_ENDL;
@@ -1320,7 +1320,7 @@ void LLViewerMedia::saveCookieFile()
 	}
 
 	// open a file for writing
-	std::ofstream file(resolved_filename.c_str());
+	llofstream file(resolved_filename.c_str());
 	if (!file.is_open())
 	{
 		LL_WARNS() << "can't open plugin cookie file \"" << PLUGIN_COOKIE_FILE_NAME << "\" for writing" << LL_ENDL;
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index 0a283efae28571ae74970acf9c884d3ae28b5cff..faa58d423f39aad36d2171bd8f62dc87e64c03c0 100755
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -135,7 +135,7 @@ void LLGridManager::initialize(const std::string& grid_file)
 				  "Aditi");
 
 	LLSD other_grids;
-	std::ifstream llsd_xml;
+	llifstream llsd_xml;
 	if (!grid_file.empty())
 	{
 		LL_INFOS("GridManager")<<"Grid configuration file '"<<grid_file<<"'"<<LL_ENDL;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index a2d9e936d527c440d0f92108f79d1d72b815a876..db49fcb0d81ec11ba3a196906911c5c15223472a 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -3001,7 +3001,7 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
 BOOL LLViewerObject::loadTaskInvFile(const std::string& filename)
 {
 	std::string filename_and_local_path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, filename);
-	std::ifstream ifs(filename_and_local_path.c_str());
+	llifstream ifs(filename_and_local_path.c_str());
 	if(ifs.good())
 	{
 		char buffer[MAX_STRING];	/* Flawfinder: ignore */
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 384589607c6298455cf3bc1fa83f7e467b283cf4..b145d9ea9dc3fcf8890043d0521a67249cd63370 100755
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -179,7 +179,7 @@ void LLViewerTextureList::doPrefetchImages()
 	// Pre-fetch textures from last logout
 	LLSD imagelist;
 	std::string filename = get_texture_list_name();
-	std::ifstream file;
+	llifstream file;
 	file.open(filename.c_str());
 	if (file.is_open())
 	{
@@ -273,7 +273,7 @@ void LLViewerTextureList::shutdown()
 	if (count > 0 && !gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "").empty())
 	{
 		std::string filename = get_texture_list_name();
-		std::ofstream file;
+		llofstream file;
 		file.open(filename.c_str());
         LL_DEBUGS() << "saving " << imagelist.size() << " image list entries" << LL_ENDL;
 		LLSDSerialize::toPrettyXML(imagelist, file);
@@ -459,7 +459,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
 	// If the image is not found, creates new image and
 	// enqueues a request for transmission
 	
-	if ((&image_id == NULL) || image_id.isNull())
+	if (image_id.isNull())
 	{
 		return (LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI));
 	}
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 351494aae781807d8e83411fde61ddcdae01c87e..e24884fe81dcb48b05d64986d764f8ad7d10add5 100755
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -1023,7 +1023,7 @@ void LLSpeakerVolumeStorage::load()
 	LL_INFOS("Voice") << "Loading stored speaker volumes from: " << filename << LL_ENDL;
 
 	LLSD settings_llsd;
-	std::ifstream file;
+	llifstream file;
 	file.open(filename.c_str());
 	if (file.is_open())
 	{
@@ -1066,7 +1066,7 @@ void LLSpeakerVolumeStorage::save()
 			settings_llsd[iter->first.asString()] = volume;
 		}
 
-		std::ofstream file;
+		llofstream file;
 		file.open(filename.c_str());
 		LLSDSerialize::toPrettyXML(settings_llsd, file);
 	}
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index e0b89e3eb9db10540358a64add5c12db117da298..374792193cade71fd9dceb05b61d5327a09694b8 100755
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -110,7 +110,7 @@ void LLWaterParamManager::loadPresetsFromDir(const std::string& dir)
 
 bool LLWaterParamManager::loadPreset(const std::string& path)
 {
-	std::ifstream xml_file;
+	llifstream xml_file;
 	std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true));
 
 	xml_file.open(path.c_str());
@@ -150,7 +150,7 @@ void LLWaterParamManager::savePreset(const std::string & name)
 	paramsData = mParamList[name].getAll();
 
 	// write to file
-	std::ofstream presetsXML(pathName.c_str());
+	llofstream presetsXML(pathName.c_str());
 	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
 	formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
 	presetsXML.close();
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp
index b5d22b42a84dd1af8be6ab267a0e864fd3f18357..b61fbbd07304cad9739741cb24d7698389f5b0ef 100755
--- a/indra/newview/llwearablelist.cpp
+++ b/indra/newview/llwearablelist.cpp
@@ -113,7 +113,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
 	else if (status >= 0)
 	{
 		// read the file
-		std::ifstream ifs(filename, std::ifstream::binary);
+		llifstream ifs(filename, llifstream::binary);
 		if( !ifs.is_open() )
 		{
 			LL_WARNS("Wearable") << "Bad Wearable Asset: unable to open file: '" << filename << "'" << LL_ENDL;
diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp
index 3f5579d0fb5cefc9faf355acb4befbef049e225c..88079c5d263f5253ba07ca3838f805a670d7a25e 100755
--- a/indra/newview/llwldaycycle.cpp
+++ b/indra/newview/llwldaycycle.cpp
@@ -109,7 +109,7 @@ LLSD LLWLDayCycle::loadDayCycleFromPath(const std::string& file_path)
 {
 	LL_INFOS("Windlight") << "Loading DayCycle settings from " << file_path << LL_ENDL;
 	
-	std::ifstream day_cycle_xml(file_path.c_str());
+	llifstream day_cycle_xml(file_path.c_str());
 	if (day_cycle_xml.is_open())
 	{
 		// load and parse it
@@ -137,7 +137,7 @@ void LLWLDayCycle::save(const std::string& file_path)
 {
 	LLSD day_data = asLLSD();
 
-	std::ofstream day_cycle_xml(file_path.c_str());
+	llofstream day_cycle_xml(file_path.c_str());
 	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
 	formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY);
 	day_cycle_xml.close();
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index ed0b733adeedb95a57c0c9a1b5bd4e0766ed1c29..2b6d88efef7ecc2b5e98fd9cd3e2eea3b0c32e09 100755
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -293,7 +293,7 @@ void LLWLParamManager::loadPresetsFromDir(const std::string& dir)
 
 bool LLWLParamManager::loadPreset(const std::string& path)
 {
-	std::ifstream xml_file;
+	llifstream xml_file;
 	std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true));
 
 	xml_file.open(path.c_str());
@@ -334,7 +334,7 @@ void LLWLParamManager::savePreset(LLWLParamKey key)
 	paramsData = mParamList[key].getAll();
 
 	// write to file
-	std::ofstream presetsXML(pathName.c_str());
+	llofstream presetsXML(pathName.c_str());
 	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
 	formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
 	presetsXML.close();
diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp
index a2f91fa55d0c24390c8be147ac2d88d698bb2401..2a8dc153466a7ee12efe56f815d7f027c9774855 100755
--- a/indra/newview/tests/llsechandler_basic_test.cpp
+++ b/indra/newview/tests/llsechandler_basic_test.cpp
@@ -585,7 +585,7 @@ namespace tut
 		LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
 		LLXORCipher cipher2(unique_id, sizeof(unique_id));
 		cipher2.encrypt((U8*)&decoded_password[0], length);
-		std::ofstream password_file("test_password.dat", std::ofstream::binary);
+		llofstream password_file("test_password.dat", std::ofstream::binary);
 		password_file.write(&decoded_password[0], length); 
 		password_file.close();
 		
@@ -719,7 +719,7 @@ namespace tut
 		test_store=NULL;
 		
 		// instantiate a cert store from a file
-		std::ofstream certstorefile("mycertstore.pem", std::ios::out);
+		llofstream certstorefile("mycertstore.pem", std::ios::out);
 		certstorefile << mPemChildCert << std::endl << mPemTestCert << std::endl;
 		certstorefile.close();
 		// validate loaded certs
diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp
index 272c2d4eb7a7f8cac86bf8cd4159e519bf0b7556..2bc0d5a08695416689f504ad8a8b0b7abfee9c2a 100755
--- a/indra/newview/tests/llslurl_test.cpp
+++ b/indra/newview/tests/llslurl_test.cpp
@@ -152,7 +152,7 @@ namespace tut
 	template<> template<>
 	void slurlTestObject::test<1>()
 	{
-		std::ofstream gridfile(TEST_FILENAME);
+		llofstream gridfile(TEST_FILENAME);
 		gridfile << gSampleGridFile;
 		gridfile.close();
 
@@ -269,7 +269,7 @@ namespace tut
 	template<> template<>
 	void slurlTestObject::test<2>()
 	{
-		std::ofstream gridfile(TEST_FILENAME);
+		llofstream gridfile(TEST_FILENAME);
 		gridfile << gSampleGridFile;
 		gridfile.close();
 
@@ -302,7 +302,7 @@ namespace tut
 	template<> template<>
 	void slurlTestObject::test<3>()
 	{
-		std::ofstream gridfile(TEST_FILENAME);
+		llofstream gridfile(TEST_FILENAME);
 		gridfile << gSampleGridFile;
 		gridfile.close();
 
diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp
index 2b0330a5b319d14a3c4f554ba80710a1229081b2..0eb0ab650065c7584ed289bf05f51e20fafc0ca1 100755
--- a/indra/newview/tests/llviewernetwork_test.cpp
+++ b/indra/newview/tests/llviewernetwork_test.cpp
@@ -245,7 +245,7 @@ namespace tut
 	template<> template<>
 	void viewerNetworkTestObject::test<2>()
 	{
-		std::ofstream gridfile(TEST_FILENAME);
+		llofstream gridfile(TEST_FILENAME);
 		gridfile << gSampleGridFile;
 		gridfile.close();
 
@@ -376,7 +376,7 @@ namespace tut
 	void viewerNetworkTestObject::test<7>()
 	{
 		// adding a grid with simply a name will populate the values.
-		std::ofstream gridfile(TEST_FILENAME);
+		llofstream gridfile(TEST_FILENAME);
 		gridfile << gSampleGridFile;
 		gridfile.close();
 
diff --git a/indra/test/llmessageconfig_tut.cpp b/indra/test/llmessageconfig_tut.cpp
index 6de5cf894d5cb97dbb7de94f90e27727d79994c1..df2151b1b1a5a3cf9bcfb878c225f698c7c90b8d 100755
--- a/indra/test/llmessageconfig_tut.cpp
+++ b/indra/test/llmessageconfig_tut.cpp
@@ -68,7 +68,7 @@ namespace tut
 
 		void writeConfigFile(const LLSD& config)
 		{
-			std::ofstream file((mTestConfigDir + "/message.xml").c_str());
+			llofstream file((mTestConfigDir + "/message.xml").c_str());
 			if (file.is_open())
 			{
 				LLSDSerialize::toPrettyXML(config, file);
diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp
index 9a537919c9c240ef74969589391027531def7961..aa23699de07298dedd615cd8b5c1e60b6f216205 100755
--- a/indra/test/message_tut.cpp
+++ b/indra/test/message_tut.cpp
@@ -120,7 +120,7 @@ namespace tut
 		void writeConfigFile(const LLSD& config)
 		{
 			std::string ostr(mTestConfigDir + mSep + "message.xml");
-			std::ofstream file(ostr.c_str());
+			llofstream file(ostr.c_str());
 			if (file.is_open())
 			{
 				LLSDSerialize::toPrettyXML(config, file);
diff --git a/indra/viewer_components/updater/CMakeLists.txt b/indra/viewer_components/updater/CMakeLists.txt
index cbf8066dee19c51e1b0000b4ed05a41367586269..61fd4220e0d310461ba59a1a2409781808dcad19 100755
--- a/indra/viewer_components/updater/CMakeLists.txt
+++ b/indra/viewer_components/updater/CMakeLists.txt
@@ -70,12 +70,12 @@ if(LL_TESTS)
       )
 
 # *NOTE:Mani - I was trying to use the preprocessor seam to mock out
-#              std::ifstream (and other) llcommon classes. I didn't work
+#              llifstream (and other) llcommon classes. I didn't work
 #              because of the windows declspec(dllimport)attribute.
 #set_source_files_properties(
 #    llupdaterservice.cpp
 #    PROPERTIES
-#      LL_TEST_ADDITIONAL_CFLAGS "-Dstd::ifstream=llus_mock_std::ifstream"
+#      LL_TEST_ADDITIONAL_CFLAGS "-Dllifstream=llus_mock_llifstream"
 #    )
 
   LL_ADD_PROJECT_UNIT_TESTS(llupdaterservice "${llupdater_service_TEST_SOURCE_FILES}")
diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp
index fc2558210029fe3a0f199ebebba67051ee00e9d7..f868e5cc2c537bfb7e90ac0d049eb044a02bfe9c 100755
--- a/indra/viewer_components/updater/llupdatedownloader.cpp
+++ b/indra/viewer_components/updater/llupdatedownloader.cpp
@@ -67,7 +67,7 @@ class LLUpdateDownloader::Implementation:
 	LLUpdateDownloader::Client & mClient;
 	CURL * mCurl;
 	LLSD mDownloadData;
-	std::ofstream mDownloadStream;
+	llofstream mDownloadStream;
 	unsigned char mDownloadPercent;
 	std::string mDownloadRecordPath;
 	curl_slist * mHeaderList;
@@ -270,7 +270,7 @@ void LLUpdateDownloader::Implementation::resume(void)
 	}
 
 	mDownloadRecordPath = downloadMarkerPath();
-	std::ifstream dataStream(mDownloadRecordPath.c_str());
+	llifstream dataStream(mDownloadRecordPath.c_str());
 	if(!dataStream)
 	{
 		mClient.downloadError("no download marker");
@@ -362,7 +362,7 @@ size_t LLUpdateDownloader::Implementation::onHeader(void * buffer, size_t size)
 			LL_INFOS("UpdaterService") << "download size is " << size << LL_ENDL;
 
 			mDownloadData["size"] = LLSD(LLSD::Integer(size));
-			std::ofstream odataStream(mDownloadRecordPath.c_str());
+			llofstream odataStream(mDownloadRecordPath.c_str());
 			LLSDSerialize::toPrettyXML(mDownloadData, odataStream);
 		} catch (std::exception const & e) {
 			LL_WARNS("UpdaterService") << "unable to read content length ("
@@ -534,7 +534,7 @@ void LLUpdateDownloader::Implementation::startDownloading(LLURI const & uri, std
 		<< " from " << uri.asString() << LL_ENDL;
 	LL_INFOS("UpdaterService") << "hash of file is " << hash << LL_ENDL;
 
-	std::ofstream dataStream(mDownloadRecordPath.c_str());
+	llofstream dataStream(mDownloadRecordPath.c_str());
 	LLSDSerialize::toPrettyXML(mDownloadData, dataStream);
 
 	mDownloadStream.open(filePath.c_str(), std::ios_base::out | std::ios_base::binary);
@@ -570,7 +570,7 @@ bool LLUpdateDownloader::Implementation::validateOrRemove(const std::string& fil
 
 bool LLUpdateDownloader::Implementation::validateDownload(const std::string& filePath)
 {
-	std::ifstream fileStream(filePath.c_str(), std::ios_base::in | std::ios_base::binary);
+	llifstream fileStream(filePath.c_str(), std::ios_base::in | std::ios_base::binary);
 	if(!fileStream)
 	{
 		LL_INFOS("UpdaterService") << "can't open " << filePath << ", invalid" << LL_ENDL;
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index 83593179832f2719e3e1a92082dabdd3eefb3e6b..c152493a5140e4a1e823a194bf45828f8432d522 100755
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -285,7 +285,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller)
 {
 	bool foundInstall = false; // return true if install is found.
 
-	std::ifstream update_marker(update_marker_path().c_str(), 
+	llifstream update_marker(update_marker_path().c_str(), 
 							 std::ios::in | std::ios::binary);
 
 	if(update_marker.is_open())
@@ -365,7 +365,7 @@ bool LLUpdaterServiceImpl::checkForResume()
 	std::string download_marker_path = mUpdateDownloader.downloadMarkerPath();
 	if(LLFile::isfile(download_marker_path))
 	{
-		std::ifstream download_marker_stream(download_marker_path.c_str(), 
+		llifstream download_marker_stream(download_marker_path.c_str(), 
 								 std::ios::in | std::ios::binary);
 		if(download_marker_stream.is_open())
 		{
@@ -460,7 +460,7 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data)
 
 	// Save out the download data to the SecondLifeUpdateReady
 	// marker file. 
-	std::ofstream update_marker(update_marker_path().c_str());
+	llofstream update_marker(update_marker_path().c_str());
 	LLSDSerialize::toPrettyXML(data, update_marker);
 	
 	LLSD event;
@@ -558,7 +558,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
 			LL_DEBUGS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;
 			int requiredValue = 0; 
 			{
-				std::ifstream stream(ll_install_failed_marker_path().c_str());
+				llifstream stream(ll_install_failed_marker_path().c_str());
 				stream >> requiredValue;
 				if(stream.fail())
 				{