Req #73433 [NEW]: could posix_fadvice be added?
| From: | divinity76 at gmail dot com | Date: | Mon, 31 Oct 2016 19:04:49 +0000 |
| Subject: | Req #73433 [NEW]: could posix_fadvice be added? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205117@lists.php.net to get a copy of this message | ||
From: divinity76 at gmail dot com
Operating system: unix*
PHP version: Next Minor Version
Package: POSIX related
Bug Type: Feature/Change Request
Bug description:could posix_fadvice be added?
Description:
------------
a php script doing file opretaions might benefit from posix_fadvice,
could that be added?
additional note: it might be worth looking into adding posix_fadvice
calls to file_put_contents / file_get_contents , namely
POSIX_FADV_SEQUENTIAL, because those always are.
Test script:
---------------
<?php
$fp=fopen('bigfile','rb');
// tell the kernel that i'm probably only going to access this data
once,
// so it's probably a waste to add this to the filesystem cache
posix_fadvice($fp,0,0,POSIX_FADV_NOREUSE);
// tell the kernel that i'm probably going to read from byte 12345 to
123456789 sequentially, so optimize for that
posix_fadvice($fp,12345,123456789,POSIX_FADV_SEQUENTIAL);
fseek($fp,12345);
$content=fread($fp,123456789-12345);
fclose($content);
// aka file_get_contents('bigfile',false,NULL,12345,123456789-12345);
--
Edit bug report at https://bugs.php.net/bug.php?id=73433&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73433&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73433&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73433&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73433&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73433&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73433&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73433&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73433&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73433&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73433&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73433&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73433&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73433&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73433&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73433&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73433&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73433&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73433&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73433&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73433&r=mysqlcfg