#22951 [Opn->Fbk]: win xp && iis 5 - copy() && unlink();
| From: | pollita@php.net | Date: | Sun, 30 Mar 2003 02:31:18 +0000 |
| Subject: | #22951 [Opn->Fbk]: win xp && iis 5 - copy() && unlink(); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36691@lists.php.net to get a copy of this message | ||
ID: 22951
Updated by: pollita@php.net
Reported By: talk_to_me at unforgiver dot net
-Status: Open
+Status: Feedback
Bug Type: *Directory/Filesystem functions
Operating System: Windows XP
PHP Version: 4.3.1
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2003-03-29 13:47:11] 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 13:31:21] 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 09:21:17] talk_to_me at unforgiver dot net
Windows XP without service pack 1.
------------------------------------------------------------------------
[2003-03-29 09:15:23] 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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22951&edit=1