php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
32 - 23 = ?
Subscribe to this entry?

 
 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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
OK
While testing my script I see this is a bug :)
But only when filesize is 0B. Why I think this is a bug ?
Because:

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
http://www.php.net/manual/pl/function.copy.php
"
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";
}else{
 //...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] pollita@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

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] sniper@php.net
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: Fri Oct 22 17:03:41 2021 UTC