note 32867 added to function.unlink
| From: | jsvlrt at t dot php dot net | Date: | Mon, 09 Jun 2003 16:02:20 +0000 |
| Subject: | note 32867 added to function.unlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50034@lists.php.net to get a copy of this message | ||
in response to rich at pulse8design dot com;
also, if, for instance you were calling
system('rm /home/foo.bar');
and the script was later moved to a windows server, this line would need to be changed as the rm
command only exists on un*x, however, unlink would still work, providing the paths were the same, I
use something like;
config.php:
<?
define('SERVER_PATH_TO_WEB_ROOT','/home/httpdoc/foo',FALSE);
?>
deleter.php:
<?
include('config.php');
unlink(SERVER_PATH_TO_WEB_ROOT."/myfile.bar");
?>
this way, I only have to change one setting if the server structure changes, and I don't need
to worry about un*x / windows issues (as much)
----
Manual Page -- http://www.php.net/manual/en/function.unlink.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32867
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32867&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32867&report=yes