|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-25 13:08 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 03:00:01 2025 UTC |
Description: ------------ When opened file grows during script run, filesize still report old size. Cached filesize? But clearstatcache() before filesize() can't help. On FreeBSD 4.3-STABLE there is no this unexpected behaviour - it's all ok without any clearstatcache(); I get my "bbbbbb" on WindowsXP/ntfs when when I use fread($fd_2, 1024) instead of fread($fd_2, filesize('test')). In production environment i'll get this behavior during concurrent file read/write from two simultaneously running script. I think at leas this behavior must be same at all platforms, so it's a bug. Reproduce code: --------------- <? $fd=fopen('test', 'wb'); fwrite($fd, 'aa'); fclose($fd); $fd_1=fopen('test', 'rb+'); $fd_2=fopen('test', 'rb+'); fwrite($fd_1, 'bbbbbb'); echo fread($fd_2, filesize('test')); fclose($fd_1); fclose($fd_2); ?> Expected result: ---------------- bbbbbb Actual result: -------------- FreeBSD 4.3-STABLE (ufs): bbbbbb Windows XP pro (ntfs): bb