I'm not sure if the Perl chdir() function accepts a ".." argument. If it
does, you can do:
chdir("..");
to go up a directory. If not, you will have to do something such as:
$currdir = `pwd`; chomp $currdir; # gets current directory
$currdir =~ s/ \/[^\/]+$//; # removes the last / and everything after it
chdir($currdir);
That's a very crude example where I'm not doing things like checking return
values or making sure we are not already in the root directory. However,
that's the general idea.
"John" <no**@none.com> wrote in message
news:81*********************@news-server.bigpond.net.au...
Sorry, but how does one move up a directory ?
I'm in a directory from which I called a script. Part of the script
functionality is checking the permissions of the directory I am in. I may
need to change the directory permissions depending on what they are.
Hence, I need to be able to move up [and possibly down] one level of the
directory tree.
chdir? Something like cd .. would be nice
Thank you.