|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22951 win xp && iis 5 - copy() && unlink();
Submitted: 2003-03-29 09:15 UTC Modified: 2003-04-06 06:59 UTC
From: talk_to_me at unforgiver dot net Assigned:
Status: No Feedback Package: *Directory/Filesystem functions
PHP Version: 4.3.1 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: talk_to_me at unforgiver dot net
New email:
PHP Version: OS:


 [2003-03-29 09:15 UTC] talk_to_me at unforgiver dot net
When I'm trying to copy few files:

$elmenets = array();
$elements[0] = 'some_file_1';
$elements[1] = 'some_file_2';
$elements[2] = 'some_file_3';
$elements[3] = 'some_file_4';
$elements[4] = 'some_file_5';

for ($i=0; $i<count($elements); $i++) {
 $copied = @copy($some_path.$elemets[$i],$some_path2.$elemets[$i]);

files are always copied but $copied sometime return true, sometime return false.
Same thing is when try to unlink files with the same method.
When remove '@' there is no error.

Permissions for directories are OK.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-29 09:21 UTC] talk_to_me at unforgiver dot net
Windows XP without service pack 1.
 [2003-03-29 13:31 UTC] talk_to_me at unforgiver dot net
While testing my script I see this is a bug :)
But only when filesize is 0B. Why I think this is a bug ?

if (@copy($some_path.$elemets[$i],$some_path2.$elemets[$i])) {
 echo 'File was copied.';
} else {
 echo 'File not copied.';

target file is created (what means the file was copied) but $copied return false.
 [2003-03-29 13:47 UTC] talk_to_me at unforgiver dot net
jay dot haslup at jhuapl dot edu
03-Mar-2003 09:52
Im using windows2000 with apache and php4.3.0.  I have noticed that copying a zero size file does actually work but PHP thinks it didn't.
if(copy("d:/dirsrc/file.txt", "d:/dirdest/file.txt"))
 //The copy works but does not end up here...
 echo "Copy worked";
 //...It ends up here
 echo "file.txt is in dirdest but ended up here";

You know that ? When you will fix it ?
 [2003-03-29 20:31 UTC]
Please try using this CVS snapshot:
For Windows:

I'm not certain about the order of the events but I believe the fix for this came after the release of PHP 4.3.0/4.3.1... Try out a current snapshot to see if it fixes things.

 [2003-04-06 06:59 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 17 18:03:40 2021 UTC