php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10993 filesize on newly made/just opened file weirdness
Submitted: 2001-05-21 13:34 UTC Modified: 2001-05-21 15:47 UTC
From: wico at cnh dot nl Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.5 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wico at cnh dot nl
New email:
PHP Version: OS:

 

 [2001-05-21 13:34 UTC] wico at cnh dot nl
Hiya

run this test script and and watch the output differ depending on using filesize or not

	$fp = fopen('file.test', "a+b");
	
	//(un)comment this line
	filesize('file.test');
	
	fwrite($fp, "boe");
	fclose($fp);

	$fp2 = fopen('file.test', "a+b");
	fseek($fp2, 0);
	echo fread($fp2, filesize('file.test'));

	unlink('file.test');

Greetz,

Wico

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-21 15:47 UTC] swm@php.net
The results of filesize() are cached. You will need to
reload the cache for this file in order that it return the
correct result.

See clearstatcache() and filesize() documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 19:01:30 2024 UTC