The cRIO requires that you call Priv_SetWriteFileAllowed(1)
before you can create files on the cRIO file system. You seem to be instantiating your ofstream object in the initialization list of your main robot class; in this case, the ofstream would attempt to create the specified file BEFORE you have allowed such an activity to take place (even if you call Priv_SetWriteFileAllowed(1) in your robot class's constructor - the initialization list gets executed first).
Also, ofstream has several methods that can be useful in diagnosing what has gone wrong. In particular, look at is_open(), good(), fail(), bad(), rdstate() here:
http://www.cplusplus.com/reference/iostream/ofstream/
Hope this helps!