in reply to working with relative paths
Relative paths should work with chdir, being relative to where you are when you run (not where the script is). Example from a Solaris Perl 5.8 system:
produces:use strict; use Cwd; print "cwd [1] = ", cwd(), "\n"; chdir("/tmp"); print "cwd [2] = ", cwd(), "\n"; chdir("steve"); # relative! print "cwd [3] = ", cwd(), "\n";
cwd [1] = /export/home/foo cwd [2] = /tmp cwd [3] = /tmp/steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: working with relative paths
by apotheon (Deacon) on Oct 30, 2004 at 02:19 UTC | |
by itub (Priest) on Oct 30, 2004 at 02:29 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 03:12 UTC | |
by fglock (Vicar) on Oct 30, 2004 at 03:27 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 03:55 UTC |