What is the size of the tested file? If it is 0 bytes then the code fails as it does not check if the length is valid.

In the other hand I can't recall whether the code created a file or not, if it does create a file then make sure the project is located in a folder that you have write access to (Vista & 7 aren't as "nice" as XP is on file permissions).