|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
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.