Or you guys could just use
CreateFileW and
GetFileSizeEx and be done with it, instead of dicking around with fseek and ftell
This would also work for locked files where seeking would fail,as you can use createfilew to "open" a file just to retrieve metadata ... and you could also use unicode paths for the file name (not sure if the fopen defaults to unicode version and wide strings)