Skip to content

Commit

Permalink
Added a few comments in the file tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneStepsInc committed Oct 27, 2023
1 parent afa115d commit 9c482b7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/file_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,7 @@ file_tracker_t::mb_file_hasher_t::param_tuple_t file_tracker_t::open_file(find_f
if(!file)
throw std::runtime_error(FMTNS::format("Cannot open file ({:s}) {:s}", strerror(errno), u8tosv_t(dir_entry.path().u8string())));

//
// Need to make sure the reference is preserved, so we update the
// actual file size value passed into this function.
//
// FILE*, file_size, version_record, dir_entry, file_read_error_t
return std::make_tuple(std::move(file), 0, std::move(version_record), std::move(dir_entry), std::nullopt);
}

Expand Down Expand Up @@ -748,6 +745,17 @@ void file_tracker_t::run(void)
catch (const std::exception& error) {
progress_info.failed_files++;

//
// TODO: This should be compiled conditionally for Windows. On
// Linux invalid characters in file paths will be handled in
// some other way. Currently observed behavior is to replace
// invalid characters with U+FFFD (e.g. mounting an NTFS volume
// with paths containing invalid characters), which which fails
// when trying to open such file, not here. Need to collect more
// info on how invalid code unit sequences are handled on Linux
// (different file systems, etc).
//

//
// Windows may store file paths with invalid UTF-16 characters,
// which fail to convert to UTF-8 paths. For example, a file
Expand Down Expand Up @@ -986,6 +994,8 @@ void file_tracker_t::run(void)
catch (const std::exception& error) {
progress_info.failed_files++;

// see TODO where filepath is assigned

//
// filepath is empty when the directory entry has a path that
// cannot be converted to UTF-8. Use a crude ASCII conversion
Expand Down

0 comments on commit 9c482b7

Please sign in to comment.