Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(crazyinsomniac) Re: Is this directory a subdirectory of another directory?

by crazyinsomniac (Prior)
on Mar 15, 2002 at 07:41 UTC ( #151933=note: print w/ replies, xml ) Need Help??


in reply to Is this directory a subdirectory of another directory?

Please don't use html too much, or at least kill the font size so it ain't so wide ... anyway

URI

File::Basename

Win32

index,rindex,substr,length,split,tr

use strict; use warnings; use Win32; die unless $^O =~ /Win32/i; my $copyme = 'C:/Apache/www-root/images'; my $here = 'C:/Apache/www-root/images/bgs'; $copyme = Win32::GetFullPathName($copyme); $here = Win32::GetFullPathName($here); # index STR, SUBSTR if( (index($copyme,$here) != -1) or (index($here,$copyme) != -1) ) { die "a horrible death"; } # Win32::GetShortPathName and Win32::GetLongPathName # may also be of interest (for use with open)
That ought to be more than enough to get you started

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


Comment on (crazyinsomniac) Re: Is this directory a subdirectory of another directory?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://151933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2014-09-22 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (178 votes), past polls