buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <alex.boisv...@gmail.com>
Subject Re: Resource filtering does not handle binary files?
Date Tue, 27 Sep 2011 19:08:01 GMT
On Tue, Sep 27, 2011 at 11:43 AM, Rhett Sutphin
<rhett@detailedbalance.net>wrote:

> > I'll fix this in Buildr so the next release doesn't apply filter mappings
> > willy-nelly on binary files.  (BTW, do you have any suggestion on good
> > binary content detection?)
>
> I looked into this when I was working on jartools[1]. I don't know how good
> it is, but I ended up using the technique that diff uses[2] -- if there are
> any null bytes, it's binary; otherwise text.
>
> Rhett
>
> [1]: https://github.com/NUBIC/jartools
> [2]: http://www.gnu.org/s/hello/manual/diff/Binary.html


I like the simplicity of it;  my main concern was returning a false-positive
on UTF8/UTF16 files but based on all the samples I could find on my machine,
it doesn't look like these use \000 so I think I'll use that.

alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message