contao/core — pull request #5458 by tristanlins (2013-03-02 10:36:56+00:00)
Title: File truncate not work for already opened files

```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.