#41754 [NEW]: copy() function returns true for copying an empty file on windows.

From: Date: Thu, 21 Jun 2007 08:06:29 +0000
Subject: #41754 [NEW]: copy() function returns true for copying an empty file on windows.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113983@lists.php.net to get a copy of this message
From: nikhil dot gupta at in dot ibm dot com Operating system: Windows PHP version: 5CVS-2007-06-21 (snap) PHP Bug Type: Filesystem function related Bug description: copy() function returns true for copying an empty file on windows. Description: ------------ When copy() function is used to make a copy of an empty file on Windows, it returns "true".But according to the documentation : "Note: Windows compatibility: If you copy a file with no size, copy() will return FALSE, but the file will be correctly copied." but it outputs true on Windows as well as Linux on both php5 and php6. This behaviour is contradictory to that mentioned in documentation. It may require change in documentation. Reproduce code: --------------- <?php $file_handle = fopen("temp.txt", "w"); fclose($file_handle); var_dump(copy("temp.txt", "tempcopy.txt")); ?> Expected result: ---------------- bool(false) Actual result: -------------- bool(true) -- Edit bug report at http://bugs.php.net/?id=41754&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41754&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41754&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41754&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41754&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41754&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41754&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41754&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41754&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41754&r=support Expected behavior: http://bugs.php.net/fix.php?id=41754&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41754&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41754&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41754&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41754&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41754&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41754&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41754&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41754&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41754&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41754&r=mysqlcfg

« previous php.bugs (#113983) next »