The file was created, so the open appear to have succeeded. If that's the case, check the error returned by print and by close. It's possible the user has a quota on that drive and has already used it up.
The file was created, so the open appear to have succeeded.
It's not clear in the original posting that this might not be an empty file in the way of the actual creation. Adding an "or die" here would be useful to rule that out.