Find files with binary content?

General discussion related to "Everything".
Post Reply
meteorquake
Posts: 499
Joined: Thu Dec 15, 2016 9:44 pm

Find files with binary content?

Post by meteorquake »

Could someone suggest the most efficient way to search within files for binary content? basically a handy way to test for corruption of non-binary files, as often null or other characters will be written - any unexpected character below ascii 32 is ideal to trigger it (so not \r \n \t). I tried something with no luck.
Probably not as efficient as having a dedicated boolean function to test for the presence of such things ("contenthasbinary:").
Many thanks!
David
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Find files with binary content?

Post by void »

regex:binary:content:[\x00-\x08\x0b-\x0c\x0e-\x1f]

regex: = enable regular expressions.
binary: = treat the search as binary and the content as binary.

binary:
meteorquake
Posts: 499
Joined: Thu Dec 15, 2016 9:44 pm

Re: Find files with binary content?

Post by meteorquake »

Cheers, that's very helpful! Found a few with it adjusted :)
I'm away from my backups and there was a rapid sequence of power fluctuations, a reboot and another set that wrecked the OS and impacted my documents partitions.
When I get back I'll MD5 all the files on these drives and the backups and spot any Modified-Size combinations that have multiple MD5s, which indicates a corruption (content changes but Modified-Size attribute stays the same), so I can pick off the uncorrupted ones to rewrite over the corrupted ones.
d
Post Reply