The resulting file on Win98 is one byte long!!
On VMS it is one block (minimum file size).
It would appear that the seek doesn't extend the file past
its current size (initially 0 bytes).
Any suggestion appreciated.
It is rather frustrating that the Q&A section is not properly threaded. I pointed out the bug in merlyn's code in Re: Answer: How do I pre-extend a file to a specified size, but looking at the node for the question, there's no indication that merlyn's answer even has a response. Meanwhile, looking at the node for merlyn's answer, there is no way to get back to the original question.
To fix the bug, swap the second and third arguments to seek:
That should be:
seek HANDLE, $desired_size -1, 0;
The second argument to seek is the number of bytes to move the position by, while the third argument is a number indicating where to start. 0 seeks from the beginning of the file, 1 seeks from the current location in the file, and 2 seeks from the end of the file.