建议成对调用
[C] 纯文本查看 复制代码 void main (void) {
FILE *f;
// Initialize the M: drive.
if (finit ("M:") != fsOK) {
// error handling
...
}
// Mount the M: drive.
if (fmount ("M:") != fsOK) {
// error handling
...
}
// Update a log file on SD card.
f = fopen ("M:\\Logs\\Test_file.log","a");
if (f == NULL) {
// error handling
...
}
else {
// write data to file
fclose (f);
}
// The drive is no more needed.
funmount ("M:");
funinit ("M:");
..
} |