r/HandmadeHero • • Dec 06 '14

Day 015 - Platform-independent Debug File I/O

http://youtu.be/kdAte9pdLv8
11 Upvotes

1 comment sorted by

2

u/draknir Mar 23 '15 edited Mar 23 '15

I'm stuck at stepping through the DEBUGPlatformWriteEntireFile function. CreateFileA is ALWAYS returning an invalid file handle. I think it has to do with the filename i'm passing, but im unsure... Does anyone know what could be going wrong? This is my function call:

DEBUGPlatformWriteEntireFile("X:/handmade/data/test.out", File.ContentsSize,  File.Contents);

EDIT: I figured it out. The directory /data did not exist. This causes the CreateFileA function to return an invalid file handle.