Skip to content

tracker-extract-text: Try to read file even if n_bytes == 0

Sam Thursfield requested to merge sam/text-errors-when-nbytes-0 into master

This makes a clear distinction between two cases:

  1. the user asked us not to read text files
  2. the user wants us to read a text file, but we can't

For a long time, our behaviour was to always insert a resource into tracker-store for the text file, even if we failed to read it. Since 2eda05bb we return an error code if we tried to read and failed. But not when org.freedesktop.Tracker.Extract.max-bytes was set to 0 as we wouldn't even try to read the file.

This commit changes the code to always read the file in order to check it exists. There is a performance penalty for users who set max-bytes to 0, but it seems unlikely that someone would do that while still having tracker-extract enabled for other types of file.

Suggested in !62 (comment 501732)

Merge request reports