+ template<typename _CharT>
+ __basic_file<_CharT>*
+ __basic_file<_CharT>::open(const char* __name, ios_base::openmode __mode,
+ int __prot)
+ {
+ __basic_file* __ret = NULL;
+ int __p_mode = 0;
+ int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
+ char __c_mode[4];
+
+ _M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
+ if (!_IO_file_is_open(this))
+ {
+ __c_file_type* __f;
+ __f = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
+ __ret = __f ? this: NULL;
+ }
+ return __ret;
+ }
+
+ template<typename _CharT>
+ bool
+ __basic_file<_CharT>::is_open() { return _fileno >= 0; }
+
+ template<typename _CharT>
+ __basic_file<_CharT>*
+ __basic_file<_CharT>::close()
+ {
+ return _IO_file_close_it(this) ? static_cast<__basic_file*>(NULL) : this;
+ }
+
+ template<typename _CharT>
+ streamsize
+ __basic_file<_CharT>::xsgetn(_CharT* __s, streamsize __n)
+ { return _IO_file_xsgetn(this, __s, __n); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ streamsize
+ __basic_file<_CharT>::sys_read(_CharT* __s, streamsize __n)
+ { return _IO_file_read(this, __s, __n); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ streamsize
+ __basic_file<_CharT>::sys_write(const _CharT* __s, streamsize __n)
+ { return _IO_file_write(this, __s, __n); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ streamoff
+ __basic_file<_CharT>::sys_seek(streamoff __pos, ios_base::seekdir __way)
+ { return _IO_file_seek(this, __pos, __way); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ int
+ __basic_file<_CharT>::sys_close()
+ { return _IO_file_close(this); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ int
+ __basic_file<_CharT>::sys_stat(void* __v)
+ { return _IO_file_stat(this, __v); }
+
+ // NB: Unused.
+ template<typename _CharT>
+ int
+ __basic_file<_CharT>::showmanyc() { return EOF; }
+
+ // NB: Unused.
+ template<typename _CharT>
+ void
+ __basic_file<_CharT>::imbue(void* /*__v*/) { }
+
+ // __basic_file<char> definitions
+ __basic_file<char>::__basic_file(__c_lock* __lock)