note 128962 added to class.spltempfileobject
| From: | Steve at main dot php dot net | Date: | Mon, 16 Oct 2023 09:08:36 +0000 |
| Subject: | note 128962 added to class.spltempfileobject | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220921@lists.php.net to get a copy of this message | ||
Since a temporary file is not a real file, some inherited methods will not work. For example,
* SplFileInfo::isReadable() and SplFileInfo::isWritable() return false, not because it was
unreadable or unwritable, but because the file does not exists.
* SplFileObject::flock() fails and returns false.
* SplFileInfo::getATime(), SplFileInfo::getCTime(), SplFileInfo::getMTime(),
SplFileInfo::getOwner(), SplFileInfo::getGroup(), SplFileInfo::getInode(), SplFileInfo::getPerms(),
and SplFileInfo::getSize() throw RuntimeException "stat failed for php://temp". However,
SplFileObject::fstat() succeeds and returns atime = mtime = ctime = uid = gid = ino = 0 together
with the correct size.
* SplFileInfo::getType throws RuntimeException "Lstat failed for php://temp".
* SplFileInfo::getLinkTarget throws RuntimeException "Unable to read link php://temp, error: No
such file or directory".
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 217.65.127.75)
----
Manual Page -- https://php.net/manual/en/class.spltempfileobject.php
Edit -- https://main.php.net/note/edit/128962
Del: integrated -- https://main.php.net/note/delete/128962/integrated
Del: useless -- https://main.php.net/note/delete/128962/useless
Del: bad code -- https://main.php.net/note/delete/128962/bad+code
Del: spam -- https://main.php.net/note/delete/128962/spam
Del: non-english -- https://main.php.net/note/delete/128962/non-english
Del: in docs -- https://main.php.net/note/delete/128962/in+docs
Del: other reasons-- https://main.php.net/note/delete/128962
Reject -- https://main.php.net/note/reject/128962
Search -- https://main.php.net/manage/user-notes.php