Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 musing on the Monastery: (8)
As of 2015-07-31 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls