|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-19 02:51 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ The touch() function truncates the file if it is a "large file" (i.e. larger than 2GB). Current PHP touch() implementation uses stat() to test if the file already exists and only checks the return value, assuming that -1 means the file does not exist. However, with large files, stat() fails with "Value too large for defined data type". Reproduce code: --------------- <?php touch("test"); ?> Expected result: ---------------- File "test" remains intact, only file times change. Actual result: -------------- File "test" is truncated to 0 (all contents is lost). This only happens when "test" was larger than 2GB.