PolMine / RcppCWB

'Rcpp' Bindings for the 'Corpus Workbench' (CWB)
Other
2 stars 3 forks source link

make cwb_encode() work on Windows #48

Closed ablaette closed 2 years ago

ablaette commented 2 years ago

The cwb_encode() function does not yet work on Windows. The reason is that transferring the "\" subdirectory separator is difficult. A solution that seems to work is to redefine the separator for the purpose of generating the registry file. Include this after #define Rprintf.

#ifdef __MINGW__
#undef SUBDIR_SEPARATOR
#undef SUBDIR_SEP_STRING
#define SUBDIR_SEPARATOR '/'
#define SUBDIR_SEP_STRING "/"
#endif

As a second step, it will be necessary to ensure that all paths are handed over to Rcpp code cleanly with "/" as separator.

ablaette commented 2 years ago

This issue is essentially solved. The remaining task is to ensure that paths are always correct. Given that normalizePath() may not be sufficiently reliable, fs::path() may be the best choice.

ablaette commented 2 years ago

Implemented as I suggested to myself.