develooper Front page | perl.beginners | Postings from February 2002

Re: AARGHHH,..... chdir(yes - no)

Thread Previous
From:
Sean O'Leary
Date:
February 11, 2002 22:42
Subject:
Re: AARGHHH,..... chdir(yes - no)
Message ID:
5.1.0.14.0.20020212012625.042278d8@pop.erols.com
I've been trying to wrap my brain around this for a little while, and I 
don't think I've been completely successful, but here's my stab at what's 
wrong.

You stated, I think, that line 27 worked and line 29 did not.  Line 27 was 
properly escaped...

>      27         #chdir("/Volumes/Music\ Tunes/Toad\ Music") || die "cant 
> open that, sorry: $!";

.... so are you sure you did that to $folder_a?  If the path in that 
variable isn't properly escaped, you'll be sunk.  Bear in mind, it may look 
correct when printed, but you'll need those escape sequences to stick 
spaces in the path (I think.)  My experience with MacOS is *extremely* 
limited, so I may be making that up.  I make a lot of similar contortions 
on Win32 to make paths with spaces work.

Another shot in the dark: you might want to check out File::Spec, for some 
help cleaning up your paths.

If you could explain some more about what the function needs to do that 
might help.  You might be going about something awkwardly.  As for no chdir 
on MacOS, I did a few Google searches and didn't come up with anything 
indicating that chdir was broken or nonexistent on any platform Perl supports.

Later,

Sean.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About