File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
components/core/src/clp_s Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 33#include < cctype>
44#include < cstddef>
55#include < cstdint>
6+ #include < filesystem>
67#include < memory>
78#include < optional>
89#include < stack>
910#include < string>
1011#include < string_view>
12+ #include < system_error>
1113#include < utility>
1214#include < vector>
1315
@@ -647,6 +649,15 @@ void JsonParser::parse_line(
647649bool JsonParser::ingest () {
648650 auto archive_creator_id = boost::uuids::to_string (m_generator ());
649651 for (auto const & [path, file_name_in_metadata] : m_input_paths_and_canonical_filenames) {
652+ if (InputSource::Filesystem == path.source ) {
653+ std::error_code ec{};
654+ auto const file_size{std::filesystem::file_size (path.path , ec)};
655+ if (std::errc{} == ec && 0 == file_size) {
656+ SPDLOG_INFO (" Skipping empty file: {}" , path.path );
657+ continue ;
658+ }
659+ }
660+
650661 auto reader{try_create_reader (path, m_network_auth)};
651662 if (nullptr == reader) {
652663 std::ignore = m_archive_writer->close ();
Original file line number Diff line number Diff line change @@ -71,6 +71,15 @@ auto convert_files(CommandLineArguments const& command_line_arguments) -> bool {
7171 }
7272
7373 for (auto const & path : command_line_arguments.get_input_paths ()) {
74+ if (clp_s::InputSource::Filesystem == path.source ) {
75+ std::error_code ec{};
76+ auto const file_size{std::filesystem::file_size (path.path , ec)};
77+ if (std::errc{} == ec && 0 == file_size) {
78+ SPDLOG_INFO (" Skipping empty file: {}" , path.path );
79+ continue ;
80+ }
81+ }
82+
7483 auto reader{clp_s::try_create_reader (path, command_line_arguments.get_network_auth ())};
7584 if (nullptr == reader) {
7685 SPDLOG_ERROR (" Failed to open input {} for reading." , path.path );
You can’t perform that action at this time.
0 commit comments