ID: 27029 User updated by: linke at paralight dot ru Reported By: linke at paralight dot ru -Status: Bogus +Status: Open Bug Type: Filesystem function related Operating System: FreeBSD4.3(ufs) / WinXPpro(ntfs) PHP Version: 4.3.4 New Comment:
Are your reading my description well? "When opened file grows during script run, filesize still report old size. Cached filesize? But clearstatcache() before filesize() can't help." I already try clearstatcache()! Previous Comments: ------------------------------------------------------------------------ [2004-01-25 00:52:18] [EMAIL PROTECTED] RTFM: Note: The results of this function are cached. See clearstatcache() for more details. ------------------------------------------------------------------------ [2004-01-24 05:02:10] linke at paralight dot ru 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27029&edit=1