We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aa6d70 commit edf7346Copy full SHA for edf7346
ext/standard/tests/file/ftruncate_bug76422.phpt
@@ -17,6 +17,15 @@ if (false === $file_handle) {
17
die('Cannot open test file :/');
18
}
19
20
+/* Check if ftruncate() with 2GB works. If it doesn't, it's likely that large files are
21
+ * generally not supported (EFBIG). */
22
+$truncate_offset = 2 * 1024 * 1024 * 1024;
23
+$ftruncate_result = ftruncate($file_handle, $truncate_offset);
24
+if (false === $ftruncate_result) {
25
+ var_dump(true);
26
+ return;
27
+}
28
+
29
$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
30
$ftruncate_result = ftruncate($file_handle, $truncate_offset);
31
0 commit comments