[darcs-users] Re: more feedback on binary file detection
Mark Stosberg
mark at summersault.com
Tue Dec 7 21:36:59 UTC 2004
On 2004-12-06, Mark Stosberg <mark at summersault.com> wrote:
> This morning I've been wrestling with darcs, because it's trying
> to tell me my Perl file has become a binary.
>
> I think it's really important for users to be able to override the
> binary file detection.
>
> I tried to use Perl to find any ^Z or NUL characters in the file, and
> it didn't find any. (Although perhaps my Perl isn't perfect):
>
> perl -ne 'print if /[^\x20-\x79]/' file.txt
I tried a similar approach with Perl today, using a different syntax,
and got the same result. I checked for exactly the characters darcs
claims to, the ASCII characters 0 and 26. It didn't find either of these
characters in the file, /and/ it doesn't match anything in my 'binaries'
file, yet darcs considers it binary. It seems like a darcs bug to me.
Here's my new script I used:
#!/usr/bin/perl -n
for my $chr (split //) {
if ((ord($chr) == 0) or (ord($chr) == 26)) {
print "chr with ASCII number ".ord($chr)."found on this line: $_\n" ;
}
}
More information about the darcs-users
mailing list