阅读C中的文件时不需要关闭
我正在使用连接到外部内存闪光灯的ESP32,在其中安装了FATFS分区。
我不明白如果我在fopen()
指令之后关闭ESP32(和flash)会发生什么。主要目的是避免被读取或写入的文件的任何损坏。
特别是我在读取文件时使用rb+
参数fopen()
,以及当我在上面写入时wb
。
在这种情况下,我可以在打开的文件上获取错误,如果发生诸如系统的不需要的开关之类的事情发生?
I'm using an ESP32 connected to an external memory flash where I mounted a FATFS partition.
I don't understand what could happen if I turn off the ESP32 (and the flash) after a fopen()
instruction. The main purpose is to avoid any corruption of the file being read or written.
In particular I use a rb+
argument for the fopen()
when I read the file, and a wb
when I write on it.
In which case I can obtain errors on the opened file, if something such as an unwanted switch off of the system happens?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论