Skip to content
Snippets Groups Projects
Commit edd8b5e0 authored by Brad King's avatar Brad King
Browse files

FStream: Open files on Windows using UNC path

This will allow long file paths to be accessed.
parent b5ca6e51
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ public:
typedef std::basic_filebuf<CharType, Traits> my_base_type;
basic_filebuf* open(char const* s, std::ios_base::openmode mode)
{
const std::wstring wstr = Encoding::ToWide(s);
const std::wstring wstr = Encoding::ToWindowsExtendedPath(s);
return static_cast<basic_filebuf*>(my_base_type::open(wstr.c_str(), mode));
}
#endif
......@@ -93,7 +93,7 @@ public:
#if defined(_MSC_VER)
const bool success = buf_->open(file_name, mode) != 0;
#else
const std::wstring wstr = Encoding::ToWide(file_name);
const std::wstring wstr = Encoding::ToWindowsExtendedPath(file_name);
bool success = false;
std::wstring cmode = getcmode(mode);
file_ = _wfopen(wstr.c_str(), cmode.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment