Skip to content

Commit

Permalink
Merge pull request #2121 from kuzudb/windows-binary-mode
Browse files Browse the repository at this point in the history
reader/csv: Use binary mode on Windows
  • Loading branch information
andyfengHKU committed Sep 30, 2023
2 parents bc74559 + 45a2362 commit 23e43b3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ BaseCSVReader::BaseCSVReader(const std::string& filePath, const common::ReaderCo
buffer(nullptr), bufferSize(0), position(0), rowEmpty(false), mode(ParserMode::INVALID),
rowToAdd(0) {
// TODO(Ziyi): should we wrap this fd using kuzu file handler?
fd = open(filePath.c_str(), O_RDONLY);
fd = open(filePath.c_str(), O_RDONLY
#ifdef _WIN32
| _O_BINARY
#endif
);
if (fd == -1) {
throw CopyException(
StringUtils::string_format("Could not open file {}: {}", filePath, strerror(errno)));
Expand Down

0 comments on commit 23e43b3

Please sign in to comment.