From caa26aa0e82b2f7ce6afe89c8ee2b28f535507de Mon Sep 17 00:00:00 2001 From: David Pilger Date: Wed, 1 Jan 2025 22:48:34 -0700 Subject: [PATCH] fixed filesize error in fromfile in support of Issue #219 --- docs/markdown/ReleaseNotes.md | 1 + include/NumCpp/Functions/fromfile.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/markdown/ReleaseNotes.md b/docs/markdown/ReleaseNotes.md index d3261be6a..c549e18ab 100644 --- a/docs/markdown/ReleaseNotes.md +++ b/docs/markdown/ReleaseNotes.md @@ -4,6 +4,7 @@ * added `putAlongAxis()` for **Issue #217** * fixed random seeding for **Issue #218** +* fixed error in `fromfile()` that limited filesize to 4GB for **Issue #219** ## Version 2.12.1 diff --git a/include/NumCpp/Functions/fromfile.hpp b/include/NumCpp/Functions/fromfile.hpp index 8f813583a..6fad90313 100644 --- a/include/NumCpp/Functions/fromfile.hpp +++ b/include/NumCpp/Functions/fromfile.hpp @@ -66,7 +66,7 @@ namespace nc } file.seekg(0, std::ifstream::end); - const uint32 fileSize = static_cast(file.tellg()); + const auto fileSize = static_cast(file.tellg()); file.seekg(0, std::ifstream::beg); std::vector fileBuffer; @@ -75,7 +75,7 @@ namespace nc if (file.bad() || file.fail()) { - THROW_INVALID_ARGUMENT_ERROR("error occured while reading the file"); + THROW_INVALID_ARGUMENT_ERROR("error occured while reading the file\n"); } file.close();