improvement: refactor readFile by Smjert · Pull Request #8410 · osquery/osquery

@Smjert

- Simplify readFile interface to only support reading full files

- Remove the choice of reading in a blocking way,
  since we want to prevent hanging

- Remove the dry run read, since it was not useful

- Split the implementation between two overloads,
  where one supports returning the whole file contents in one go,
  while the other calls back a predicate everytime some data is read,
  up to a fixed block size (as with the previous implementation)

@Smjert Smjert marked this pull request as ready for review

September 17, 2024 18:19

directionless

@Smjert Smjert deleted the stefano/improvement/readfile-nonblock branch

October 8, 2024 13:20

@zwass zwass mentioned this pull request

Apr 22, 2025

zwass added a commit that referenced this pull request

Jun 3, 2025
A refactor of the `readFile` function (in #8410) caused all parsing of shortcut files to fail. The test had a bug that caused the relevant checks to be skipped.

Fixes #8599