in reply to Re^4: system and &>/dev/null
in thread system and &>/dev/null
The behavior is undefined if LENGTH is greater than the length of the file.so IMHO seek is used to extend the file length first. It works without seek under Linux but might not be under other OS. BTW, seek alone without truncate results in an empty (0-byte) file.
For the usage of eval and close return:
This is basic error handling, when either seek or truncate fails I close the filehandle and return, with returns undef(=false) so that the caller know it didn't work. Otherwise I return an non-zero value to show success.
|
---|