Karl Williamson <public <at> khwilliamson.com> writes: >It seems to me that every true binary file will contain plenty of NULs, >so it seems overkill to look at anything else Perhaps so, but in that case not every non-binary file is text. It might be some structured format like ASN.1 which cannot be printed as text but happens not to contain any \0 bytes either. Then there are images in simple formats like Windows .BMP or .ICO, where if there are no black pixels there might not be any zero bytes either. For the purposes of Perl's file tests, 'binary' should mean 'any format which cannot be printed intelligibly as text in the console or a text editor'. So I think you should check a bit more than just the absence of zero bytes. -- Ed Avis <eda@waniasset.com>Thread Previous | Thread Next