in reply to Re: Getting File Type using Regular Expressions
in thread Getting File Type using Regular Expressions
An easy (but not fool proof) way of distinguishing between a text file or a binary file is use the ready-made -B file check operator. Or the -T (depending on which way your flag flies).
or if you are a "NOT" guy/girl the following might suit your fancy.print "File is binary\n" if (-B); print "File is a text file\n" if (-T);
Hope that helps some.print "File is binary\n" if (!-T); print "File is a text file\n" if (!-B);
|
|---|