[nycphp-talk] relative paths in Windope
Andy Dirnberger
dirn at dirnonline.com
Sun Sep 24 17:27:44 EDT 2006
Is http://us3.php.net/getcwd what you're looking for?
mkdir (getcwd () . "\\directoryname");
DiRN
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of David Krings
Sent: Sunday, September 24, 2006 5:14 PM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] relative paths in Windope
Hi,
although I managed to find a workaround I still wonder how one can make use
of relative paths on Windows when using commands such as mkdir, rmdir,
unlink, etc.
For example:
unlink(.\oh11je9qfrh9ns3evmee794qh3\PDRM0660.JPG)
fails with this error
No such file or directory in
E:\piviviewer\administration\pics\addpictosystem.php on line 276
but the file in the directory in which the script file is located has the
folder oh11je9qfrh9ns3evmee794qh3 and in that is the file PDRM0660.JPG.
For now I created a function that figures out what the path is to the
current location by taking the [SCRIPT_FILENAME] of $_SERVER and cutting
the filename of the current script file off at the end (I vaguely remember
that there is a better way to do this with some command that just returns
the path portion) and then combine this with the path and file to be
deleted.
That is quite annoying, but using relative paths on Windope doesn't work as
it seems. Anyone has a better solution (besides dumping Windoof) than to
massage strings until it fits?
Thank you very much in advance.
David K.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
More information about the talk
mailing list