[php-src] Issue #13280: tmpfile() $mode argument
| From: | divinity76 | Date: | Tue, 30 Jan 2024 22:43:00 +0000 |
| Subject: | [php-src] Issue #13280: tmpfile() $mode argument | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246369@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13280
Author: divinity76
### Description
I want a tmpfile() in
a+b mode, quote
>In this mode, [fseek()](https://www.php.net/manual/en/function.fseek.php) only affects the
>reading position, writes are always appended.
I want a tmpfile() where fseek() only affect the reading position, and writes are always appended. I
cannot use fopen("php://temp","a+b") because I need the file uri
(stream_get_meta_data($fp)['uri'])
I wish tmpfile() had a $mode option like:
```
tmpfile(string $mode = "w+b"): resource|false
```
So I could do
```
$fp = tmpfile("a+b");
```