Skip to content

Instantly share code, notes, and snippets.

@Youka
Created May 18, 2015 18:47
Show Gist options
  • Select an option

  • Save Youka/d5313cdab9108b73282a to your computer and use it in GitHub Desktop.

Select an option

Save Youka/d5313cdab9108b73282a to your computer and use it in GitHub Desktop.
MinGW wifstream
#include <ext/stdio_filebuf.h> // fstream (all sorts of IO stuff) + stdio_filebuf (=streambuf)
#include <fcntl.h> // _O_RDONLY
#include <iostream> // cout
int main(){
__gnu_cxx::stdio_filebuf<char> wfile_buf(_wopen(L"D:\\...\\の.txt", _O_RDONLY), std::ios_base::in);
std::istream wfile_stream(&wfile_buf);
wfile_stream.seekg(0, std::ios_base::end);
std::cout << wfile_stream.tellg();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment