SplTempFileObject クラス
(PHP 5 >= 5.1.2, PHP 7, PHP 8)
はじめに
SplTempFileObject クラスは、一時ファイルへのオブジェクト指向インターフェイスを提供します。
クラス概要
/* 継承した定数 */
/* メソッド */
/* 継承したメソッド */
public SplFileObject::fgetcsv(string
$separator
= ",", string $enclosure
= "\"", string $escape
= "\\"): array|falsepublic SplFileObject::fputcsv(
array
string
string
string
string
): int|false
array
$fields
,string
$separator
= ",",string
$enclosure
= "\"",string
$escape
= "\\",string
$eol
= "\n"): int|false
public SplFileObject::setCsvControl(string
$separator
= ",", string $enclosure
= "\"", string $escape
= "\\"): voidpublic SplFileInfo::openFile(string
}$mode
= "r", bool $useIncludePath
= false
, ?resource $context
= null
): SplFileObject目次
- SplTempFileObject::__construct — 新しい一時ファイルオブジェクトを作成する
+add a note
User Contributed Notes 1 note
Steve ¶
1 year ago
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".
↑ and ↓ to navigate •
Enter to select •
Esc to close
Press Enter without
selection to search using Google