CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Driver file mmcdos.c and how to write in existing file

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eng.alamin



Joined: 08 Sep 2008
Posts: 17

View user's profile Send private message

Driver file mmcdos.c and how to write in existing file
PostPosted: Fri Dec 05, 2008 4:47 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group