DAddYE/foreverb — Issue #16: Truncating logfile is difficult
Author: niko
Created: 2012-01-05 09:34:24+00:00
State: open

I don't know if that's an issue but I noticed that truncating the logfile (the redirected STDOUT) doesn't work, at least the way expected. When doing

```
echo '' > out.log
ls -l out.log
```

`ls` still shows the old filesize. `df` shows the diskspace being freed. The logfile contains somehow invisible characters. It seems the open file should be rewinded or seek the beginning again. I work around this with this code at the moment:

```
Signal.trap('USR2'){ STDOUT.truncate 0 ; STDOUT.rewind }
```

To reproduce see https://gist.github.com/1564418