Forum Moderators: coopster & phranque

Message Too Old, No Replies

Relative Directories

         

Brett_Tabke

9:23 am on Aug 20, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How universal is the relative directory notation:

"./"

Seems to work on everything I've encountered, but I have a hunch that it is risky on some systems?

Given a script is in root, and there is a directory "foo" below it - how risky is:

$foo ="foo";
$file ="rocks.txt";
$fp ="./$foo/$file";
open(FILE "<$fp");

(I wonder about NT and Macs)...

alexjc

7:14 pm on Aug 21, 2001 (gmt 0)

10+ Year Member



I've never had trouble using ./

One thing though, since it's the current directory, why specify it explicitly?

$fp ="$foo/$file";

That should do the trick nicely if you're still not confident with ./

Alex