View Issue Details

IDProjectCategoryView StatusLast Update
0000772PHP for OS/2, ArcaOS & eComStation (PHP versions v8.x v7.x v5.x)Bugpublic2022-10-02 18:39
Reporterpsmedley Assigned Topsmedley  
Status resolvedResolutionfixed 
Product Version8.1.x 
Summary0000772: PHP copy() fails with certain files
DescriptionFirst reported by Lewis with Wordpress, now distilled to a simple testcase.

Running copy.php (attached), with the source file being a PNG of 393810 bytes, copy() returns a failure code per below:

Notice: copy(): Write of 393810 bytes failed with errno=22 Invalid argument in E:\web\copy.php on line 5
failed to copy roof.png...

Copy does work ok for a small text file < 200 bytes - it has not determined what file size triggers the failure.
TagsNo tags attached.
Attached Files
copy.php (133 bytes)   
$file = 'roof.png';
$newfile = 'roof.png.bak';

if (!copy($file, $newfile)) {
    echo "failed to copy $file...\n";
copy.php (133 bytes)   



2022-10-02 10:52

administrator   ~0004604

Given that roof.png.bak ends up containing 4096 bytes, I'm going to suggest this is the file size below which things will work.


2022-10-02 18:39

administrator   ~0004605

Fixed in (with thanks to Steven).

New php.dll at Full new build to follow.

Issue History

Date Modified Username Field Change
2022-10-02 10:47 psmedley New Issue
2022-10-02 10:47 psmedley Status new => assigned
2022-10-02 10:47 psmedley Assigned To => psmedley
2022-10-02 10:47 psmedley File Added: copy.php
2022-10-02 10:52 psmedley Note Added: 0004604
2022-10-02 18:39 psmedley Status assigned => resolved
2022-10-02 18:39 psmedley Resolution open => fixed
2022-10-02 18:39 psmedley Note Added: 0004605