by frag.machine » Wed Nov 20, 2013 2:41 pm
The file I/O part seems OK. Have you tested create_waypoint() separately? Something like adding a impulse to spawn a hardcoded waypoint just to see if it works?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC 
(LordHavoc)