1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

Skip large ftruncate test if large files not supported

This commit is contained in:
Nikita Popov
2019-10-24 14:32:11 +02:00
parent 6aa6d70e9d
commit edf7346810
@@ -17,6 +17,15 @@ if (false === $file_handle) {
die('Cannot open test file :/');
}
/* Check if ftruncate() with 2GB works. If it doesn't, it's likely that large files are
* generally not supported (EFBIG). */
$truncate_offset = 2 * 1024 * 1024 * 1024;
$ftruncate_result = ftruncate($file_handle, $truncate_offset);
if (false === $ftruncate_result) {
var_dump(true);
return;
}
$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
$ftruncate_result = ftruncate($file_handle, $truncate_offset);