|
发表于 2019-9-9 10:45:40
|
显示全部楼层
正好我也用到使用FlashFS,从SD卡复制到NAND flash,遇到复制过去的文件,打开内容不一样,不知道问题出在哪里
FILE *fpin, *fpout;
int ch;
if((fpin = fopen("D:\1.txt","rb")) == NULL)
{
printf("1 can't open file! /n");//文件打开失败打印输出
return;
}
if((fpout = fopen("D:\2.txt","wb")) == NULL)
{
close(fpin);
printf("2 can't open file! /n");
return;
}
ch = getc(fpin);
while(!feof(fpin))
{
putc(ch,fpout);
ch = getc(fpin);
}
fclose(fpin);
fclose(fpout);
fpin = NULL;
fpout = NULL; |
|