contao/core — pull request #5459 by tristanlins (2013-03-02 10:38:21+00:00)
Title: Fix File::truncate() for already opened streams.

```php
$file = new File('example.txt');

$file->truncate(); // -> fopen('example.txt', 'wb') will truncate the file
$file->write('foo'); // -> fputs($handle, 'foo')

$file->truncate(); // -> fputs($handle, '') => will not truncated because handle is already opened!
$file->write('bar'); // -> fputs($handle, 'bar')
```

The file `example.txt` will contain `foobar` and **not** `bar` as expected.