phiresky / ripgrep-all

rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.
Other
6.51k stars 153 forks source link

Ignore Office lock files #151

Open pu-238 opened 1 year ago

pu-238 commented 1 year ago

I've noticed that when I'm running RGA on a folder it's hitting the lock files created by Word when a file is open and the preprocessor fails.

Chapter 4/~$cture4.docx: preprocessor command failed: '"/usr/local/bin/rga-preproc" "Chapter 4/~$cture4.docx"':
-------------------------------------------------------------------------------
adapter: pandoc
couldn't unpack docx container: Did not find end of central directory signature
Error: subprocess failed: ExitStatus(unix_wait_status(16128))
-------------------------------------------------------------------------------
phiresky commented 9 months ago

You can exclude files with normal rg methods (.ignore, .gitignore or -g '!~$*').

I'll rename this issue since maybe we might want to exclude files office lock files starting with ~$ by default. But maybe not, not sure.

Also not sure if this issue still happens with a current pandoc version.