Title: RE: How can I figure out whether it is binary file or ASCII file unde r one directory?

Try reading the first 128 bytes of the file, and scanning for
any characters < 32 (except maybe x1B,x0c,x0a,x0d) ESC,TOF,CR,LF
or > 127. However, this might be a problem with some extended ASCII
characters.

George

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, October 10, 2002 1:54 PM
>To: [EMAIL PROTECTED];
>[EMAIL PROTECTED];
>[EMAIL PROTECTED]
>Subject: How can I figure out whether it is binary file or ASCII file
>unde r one directory?
>
>
>Dear all,
>
>A question, How can I figure out whether it is binary file or
>ASCII file
>under one directory using perl? Does perl have a function for
>that? I have a
>project to pick up various binary files from some directories.
>
>Thanks in advance!
>Have a nice day!
>
>Lixin
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

Reply via email to