note 113652 added to function.touch
| From: | anon | Date: | Sun, 10 Nov 2013 16:38:59 +0000 |
| Subject: | note 113652 added to function.touch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197487@lists.php.net to get a copy of this message | ||
Note that when PHP is called by f.e. apache or nginx instead of directly from the command line,
touch() will not prefix the location of the invoking script, so the supplied filename must contain
an absolute path.
With script started from /home/user/www, this will not touch "/home/user/www/somefile":
<?php
touch( 'somefile' );
?>
But this will:
<?php
touch( __DIR__ . '/somefile' );
?>
----
Server IP: 64.71.164.2
Probable Submitter: 83.180.245.84
----
Manual Page -- http://php.net/manual/en/function.touch.php
Edit -- https://master.php.net/note/edit/113652
Del: integrated -- https://master.php.net/note/delete/113652/integrated
Del: useless -- https://master.php.net/note/delete/113652/useless
Del: bad code -- https://master.php.net/note/delete/113652/bad+code
Del: spam -- https://master.php.net/note/delete/113652/spam
Del: non-english -- https://master.php.net/note/delete/113652/non-english
Del: in docs -- https://master.php.net/note/delete/113652/in+docs
Del: other reasons-- https://master.php.net/note/delete/113652
Reject -- https://master.php.net/note/reject/113652
Search -- https://master.php.net/manage/user-notes.php