View Issue Details

IDProjectCategoryView StatusLast Update
0000772PHP for OS/2, ArcaOS & eComStation (PHP versions v8.x v7.x v5.x)Bugpublic2022-10-02 08:09
Reporterpsmedley Assigned Topsmedley  
PrioritynormalSeveritymajorReproducibilityalways
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)   
<?php
$file = 'roof.png';
$newfile = 'roof.png.bak';

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

Activities

psmedley

2022-10-02 00:22

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.

psmedley

2022-10-02 08:09

administrator   ~0004605

Fixed in https://github.com/psmedley/php-os2/commit/6ec38571f5a8c0e91585a0f4db1b37fa186d8089 (with thanks to Steven).

New php.dll at https://smedley.id.au/tmp/php-8.1-dll-20221002c.zip Full new build to follow.

Issue History

Date Modified Username Field Change
2022-10-02 00:17 psmedley New Issue
2022-10-02 00:17 psmedley Status new => assigned
2022-10-02 00:17 psmedley Assigned To => psmedley
2022-10-02 00:17 psmedley File Added: copy.php
2022-10-02 00:22 psmedley Note Added: 0004604
2022-10-02 08:09 psmedley Status assigned => resolved
2022-10-02 08:09 psmedley Resolution open => fixed
2022-10-02 08:09 psmedley Note Added: 0004605