my $file = "a_binary_file.exe";
# my $file = "a_text_file.txt";

if (-B $file) # -B is opposite of -T (text)
{
        print "$file is binary\n";
}
else
{
        print "$file is NOT binary\n";
}




> -----Original Message-----
> From: George P. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 15, 2002 2:53 PM
> To: [EMAIL PROTECTED]
> Subject: How to check between text & binary files
> 
> 
> 
> Hi,
> 
> I want to write a .pl that will take in filenames as
> parameters, and print out whether the files are text files
> or binary files.
> 
> The problem I'm having is that I can't figure out a good rule
> to use while deciding whether a file is a text-file or a binary-file.
> 
> If someone has created such a program or has any good suggestions,
> I would like to hear it.
> 
> Thanx
> George
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to