I have the following code
my $fh = FileHandle->new(">>$log_file") || die "could not open $log_fi
truncate $fh,0 || die "could not truncate $log_file: $!";
$fh->close() || die "could not close $log_file: $!";
When running the code i get the error
could not truncate ....: Inappropriate ioctl for device at maintain.pl line 39.
I tried to find the solution with google.
The only restriction i found is that the file has to be opened in append mode (which is our case)
What are i am doing wrong?