On Thu, 29 Nov 2001, Carl Rogers wrote:

> At 08:09 PM 11/29/2001 +0000, [EMAIL PROTECTED] wrote:
> >How can I do more then one file test for file?
> >
> >I'm trying to test a list of files to see if they're a binary file, that
> >isn't executable.
>
> If I understand correctly, you want to check all files in a certain
> directory to see if they AREN'T executables?
> In WIN NT:

The canonical (and portable) way of doing this in Perl is to use the -X
operators

-B determines if the file is binary
-x determines if the file is executable

so, for each file you could do

if(-B "$file" && ! -x "$file" ) {

        #do stuff
}

I believe these operators work under Win32 as well as Unix systems.

See perldoc -f -X for more details.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Rotten wood cannot be carved.
                -- Confucius, "Analects", Book 5, Ch. 9


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

Reply via email to