This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 5.3 fopen() issue: Opens 2 files with same file pointer

I'm working on a port of the x264 codec into CCS. The encoding algorithm needs two files, a raw video input file and an output file.

The output file pointer is opened first. The fopen is successful, and an empty output file ("out.mkv") is created in the directory. The file pointer is valid, and is stored in the program's data structures for later writes.

Shortly thereafter, the input file is opened, again successfully, but the pointer that fopen returns is the same as the output file pointer. Note that the output file pointer has not been closed.

I have absolutely no idea what is going wrong here. I'm pretty new to CCS, but in terms of C programming, I've never seen this happen before. This code is being ported from an existing Visual Studio project, and the logic of the file I/O has not been changed.

Code Composer Studio 5.3;     Generic C64x+ Device;     TI v7.4.1 Compiler