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.

[参考译文] LAUNCXL-CC1310:fopen()的问题

Guru**** 2524550 points
Other Parts Discussed in Thread: CC1310

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1090213/launchxl-cc1310-problem-with-fopen

部件号:LAUNCHTXL-CC1310
主题中讨论的其他部件:CC1310

我正在尝试打开并读取二进制文件。  

我正在使用以下代码:

                  FILE* BinFile;
                  BinFile = fopen("output123.bin", "rb");

                  if(BinFile)
                  {
                      Display_printf(displayHandle, 0, 0, "File exists... = %x \n", BinFile);
                  }

                  if (BinFile == NULL)
                  {
                      Display_printf(displayHandle, 0, 0, "Error opening file...\n");

                      perror("fopen");
                      return (NULL);
                  }

现在的问题是文件"output123.bin"在任何地方都不存在,但我没有收到错误消息,而是输出为:  

         File exists... = 20002120

当我尝试读取实际存在于同一目录中的文件时,读取的内容完全错误。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    由于我认为这不是与CC1310相关的问题,我已将此帖子移至CCS论坛

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尽管这篇文章的标题是这样的,但请告诉我 使用printf的提示 之一是有帮助的。

    谢谢,此致,

    -George