Browse Source

Windows one more try

batman
boB Rudis 4 years ago
parent
commit
6a7aa05757
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 8
      src/code.cpp

8
src/code.cpp

@ -1,3 +1,4 @@
#include <locale>
#include "request.h"
#include "httprequestparser.h"
@ -9,6 +10,7 @@
#include <fstream>
#include <string>
#include <sys/stat.h>
#include <stdlib.h>
#include <Rcpp.h>
using namespace Rcpp;
@ -358,8 +360,11 @@ RawVector read_file_raw(CharacterVector fil, int buffer_size = 16384) {
if (in) {
#ifdef _WIN32
std::string f = std::string(fil[0]);
wchar_t wfil[f.length()*2];
std::mbstowcs(&wfil[0], f.c_str(), f.length()*2);
struct _stati64 st;
_wstati64(file[0].begin(), &st)
_wstati64(&wfil[0], &st);
#else
struct stat st;
stat(fil[0].begin(), &st);
@ -378,4 +383,3 @@ RawVector read_file_raw(CharacterVector fil, int buffer_size = 16384) {
}
}

Loading…
Cancel
Save