eng.alamin
Joined: 08 Sep 2008 Posts: 17
|
Driver file mmcdos.c and how to write in existing file |
Posted: Fri Dec 05, 2008 4:47 pm |
|
|
hello guys
I am using MMCDOS.C driver to read and write in sd card.
My sd card is 256 MB FAT Format.
I stored text file named GPS.TXT.
Fortunately I successfully can open this file and read it
by using this code line:
Code: |
strcpy(fname,"GPS.TXT");
rec_size=MMC_BUFF_SIZE;
error0=open_file(0,fname,rec_size);
do {
error0=file_read(0,buff0);
if (error0>0 && error0<255 )
{
printf("\n\r fread 0 failed error=%U\n\r",error0);
break;
}
printf("%s",buff0);
rec_no++;
} while (error0==0); |
---------------------------------------------------------
Remember this code is based on mmcdos.c driver
---------------------------------------------------------
Now I want to write in this file (gps.txt).
I tried to use
Code: | int file_write(int8 fnbr,int *buff); |
but I didn't know how to use it correctly.
If anyone has been involved with this issue before please help me.
How to write string in sd card using this function ?
regards |
|