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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user