|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-18 14:15 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 21:00:01 2025 UTC |
Description: ------------ On Windows, when the destination file in copy() is flocked, the destination ends up as an empty file. On linux, the example code works as expected. Reproduce code: --------------- // echo foo > foo.txt // echo bar > bar.txt $fp = fopen('foo.txt', 'r'); @flock($fp, LOCK_EX); copy('bar.txt', 'foo.txt'); fclose($fp); Expected result: ---------------- c:\cat foo.txt bar.txt foo bar Actual result: -------------- c:\cat foo.txt bar.txt bar (File foo.txt is empty.)