Re: fopen -- bug or feature ?

From: Date: Thu, 12 Oct 2000 15:34:23 +0000
Subject: Re: fopen -- bug or feature ?
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-1489@lists.php.net to get a copy of this message
Hello, This list is for discussing PHP Quality Assurance. Please direct your support questions to the general php mailing list (php-general@lists.php.net -- php-general-subscribe@lists.php.net to subscribe) - zak At 03:58 PM 10/12/00 +0200, Matja¾ Ostrover¹nik wrote:
Hi ! Asumme the following script: <? echo pwd; $file = $argv[1]; $fd=fopen($fil, "r"); echo fread($fd, 10000); ?> and relative path for input parameter (e.g. ../Makefile) If I run it from the same directory as the scipt lies, it's ok. If I run it from a different directory it fails, since upon script start it changes current directory to the directory where script lies. This behaviour is very annoying since I must define absolute paths to have scripts in one, data files in second and makefile invocation point in third directory, but I'd like to have relative paths in makefile. Yes I know that I can use $(HOME) (i.e. absolute paths), but then I have very long command lines (asume all modules, libraries etc.) I tried to convert realtive path to absolute path in php program, but no luck. 'realpath' returns "" if the file does not exist. So it's uselless in this occasion. Some hints? Regards Matjaz -- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-qa-unsubscribe@lists.php.net For additional commands, e-mail: php-qa-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.qa (#1489) next »