fwrite() more than 2 GiB? [duplicate]
This question already has an answer here: Is fopen() limited by the filesystem? 4 answers I have a set of files that I want to concatenate (each represents a part from a multi-part download). Each splitted file is about 250MiB in size, and I have a variable number of them. My concatenation logic is straight-forward: if (is_resource($handle = fopen($output, 'xb')) === true) { foreach ($parts as $part) { if (is_resource($part = fopen($part, 'rb')) === true) { while (feof($part) !== true) { fwrite($handle, fread($part, 4096)); } fclose($part); } } fclose($handle); } It took me a while to trace it