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