|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-09 23:28 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 12:00:02 2025 UTC |
Description: ------------ When filesize() is applied on a symbolic link to a file, it returns the size of the file pointed by it instead of returning the size of symlink itself. This is happening for both php5 and php6. Is this the valid behavior? Reproduce code: --------------- <?php $file_handle = fopen("test.tmp", "w"); fwrite( $file_handle, str_repeat("Hello World, this is 2007 year ....\n", 100) ); fclose($file_handle); symlink("test.tmp", "test_symlink.tmp"); //creating symlink var_dump( filesize("test_symlink.tmp") ); //size of the symlink itself clearstatcache(); var_dump( filesize("test.tmp") ); //size of the file clearstatcache(); unlink("test_symlink.tmp"); unlink("test.tmp"); ?> Expected result: ---------------- -sizeof(symlink)- int(3600) Actual result: -------------- int(3600) int(3600)