[maemo-developers] Wrting to a text file in N800 /media/mmc1
From: nisha jain jain61 at gmail.comDate: Sun Jul 6 07:12:18 EEST 2008
- Previous message: Wrting to a text file in N800 /media/mmc1
- Next message: Wrting to a text file in N800 /media/mmc1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Ed, I just checked too I got this suggestion and tried, it is also not working :( I am very amazed why it is not working? So i am trying following now-- #include<stdio.h> >> >> void main() >> { >> FILE *Gfile; >> if ((Gfile = fopen("/media/mmc1/test.txt", "w+")) == NULL) >> { >> printf("Error in file creation"); >> } >> >> if(Gfile) >> fprintf(Gfile,"%02x",0x10); >> fclose(Gfile); >> } Regards, Nisha On 7/5/08, ed at okerson.com <ed at okerson.com> wrote: > > Nisha, > > Try changing the mode flags to "w+", I don't think "wt+" is valid. If you > do a `man fopen` on a linux machine you will see there is no "t" option > for mode flags. > > Ed Okerson > > > Hi All, > > > > I checked permission issue I also tried locking/ unlocaking the memory > > card > > but program below is not working.. > > > > I have permission of writing but it is not generating a simple text file > > from the following c program which works > > > > perfectly fine into maemo ARMEL enviornment so called N800 replica.. What > > could be the issue? > > > > Any inputs will be highly appreciated....... > > > > Regards, > > Nisha > > > > > > On 7/5/08, nisha jain <jain61 at gmail.com> wrote: > >> > >> Hi All, > >> > >> I just checked in N800 the following program for writing into a file > >> which > >> > >> doesn't work.... Any clues what is going wrong? I neither get any error > >> not > >> it is > >> > >> creating a file and writing into it......... > >> > >> #include<stdio.h> > >> > >> void main() > >> { > >> FILE *Gfile; > >> if ((Gfile = fopen("/media/mmc1/test.txt", "wt+")) == NULL) > >> { > >> printf("Error in file creation"); > >> } > >> > >> if(Gfile) > >> fprintf(Gfile,"%02x",0x10); > >> fclose(Gfile); > >> } > >> > >> Regards, > >> Nisha > >> > >> On Sat, Jul 5, 2008 at 5:34 PM, nisha jain <jain61 at gmail.com> wrote: > >> > >>> Hi Gray, > >>> > >>> I checked the file pointer if it is NULL I am printing error message > >>> and > >>> returning too. > >>> > >>> Also i am checking while writing into a file that file pointer is not > >>> NULL. > >>> > >>> I have tested it on mameo (ARMEL) enviornment and it is working > >>> absolutely > >>> fine > >>> > >>> I am not able to understand while after porting to N800 it doesn't show > >>> up > >>> any file created on flash > >>> > >>> at least it should create an empty file......Does there is some > >>> restriciton in writing into flash? > >>> > >>> Regards, > >>> Nisha > >>> > >>> > >>> On Sat, Jul 5, 2008 at 2:29 PM, gary liquid <liquid at gmail.com> wrote: > >>> > >>>> nisha, > >>>> > >>>> check you have included appended the filename on the end of the path > >>>> in > >>>> your adjusted program. > >>>> Check the return values of all functions called and do not assume > >>>> success > >>>> for anything. > >>>> Most importantly, put printf("fn msg/n"); calls around your program > >>>> at > >>>> relevant points. > >>>> The printfs will help you debug by showing you where your software got > >>>> to > >>>> and optionally whatever additional information you want to display. > >>>> > >>>> Gary (lcuk on maemo) > >>>> > >>>> On Sat, Jul 5, 2008 at 6:54 PM, nisha jain <jain61 at gmail.com> > wrote: > >>>> > >>>> > >>>>> hi All, > >>>>> > >>>>> I wrote a program which is collecting some data and creating text > >>>>> file > >>>>> to write into. > >>>>> > >>>>> I am successfully able to run and execute it in the VmWare maemo > >>>>> enviornment without any problem. > >>>>> > >>>>> When i deployed it into N800 I am getting segmentation fault this > >>>>> application I checked in ARMEL compiled > >>>>> > >>>>> mode on VmWare... I am not sure how to debug it as it is working fine > >>>>> in > >>>>> the Maemo enviornment but crashes > >>>>> > >>>>> on the actual N800 device... Only change is the file created in > >>>>> > >>>>> using like fopen ("filename", "wt"); > >>>>> > >>>>> in the Maemo and in case of N800 fope("/media/mmc1", "wt") > >>>>> > >>>>> I tired checking if file gets created to /media/mmc1 or not but it > >>>>> doesn't get created their at all................. > >>>>> > >>>>> Let me know if some one has idea? > >>>>> > >>>>> Regards, > >>>>> Nisha > >>>>> > >>>>> > >>>>> _______________________________________________ > >>>>> maemo-developers mailing list > >>>>> maemo-developers at maemo.org > >>>>> https://lists.maemo.org/mailman/listinfo/maemo-developers > >>>>> > >>>>> > >>>> > >>> > >>> > >> > >> > > _______________________________________________ > > maemo-developers mailing list > > maemo-developers at maemo.org > > https://lists.maemo.org/mailman/listinfo/maemo-developers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20080705/db29e0de/attachment.htm
- Previous message: Wrting to a text file in N800 /media/mmc1
- Next message: Wrting to a text file in N800 /media/mmc1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]