<html>
<head>
</head>
<body>
<br>
<br>
Angelo Fraietta wrote:<br>
<blockquote type="cite" cite="mid:3E9BB1D6.1030605@bigpond.com"> I have
implemented this into my app, hwoever, when I try to examine the file, I
get zero bytes.<br>
I did the following<br>
<br>
fd = open(nvram_file,O_WRONLY | O_CREAT | O_TRUNC,S_IREAD|S_IWRITE);<br>
if (fd <0)<br>
{<br>
printf ("Unable to open %s\r\n", nvram_file);<br>
}<br>
else<br>
{<br>
unsigned i;<br>
for (i = 0; i < 255; i++)<br>
{<br>
char c = (char) i;<br>
int bytes = write(fd, &c, 1);<br>
printf ("Wrote %u bytes \r\n", bytes);<br>
}<br>
close(fd);<br>
printf ("Close file\r\n");</blockquote>
ignore this next line as this was an attempt to see if re-initialising would
help<br>
<blockquote type="cite" cite="mid:3E9BB1D6.1030605@bigpond.com"><br>
fileio_part_table_initialize (); <br>
}<br>
<br>
I got the correct output to my display, however, the file written is zero
bytes. Any idea as to what I am doing wrong?<br>
<br>
Thomas Doerfler wrote:<br>
<blockquote type="cite" cite="mid:3E7AD80B.4667.253903@localhost">
<pre wrap="">Hello,<br><br></pre>
<blockquote type="cite">
<pre wrap="">I got the program working and it worked fine with my flash disk.<br><br>I did, however, have to type my filenames in UPPER CASE. I don't know <br>whether this is something peculiar with the DIMMPC flash IDE or not.<br></pre>
</blockquote>
<pre wrap=""><!----><br>I am glad things are working for you now. The upper case <br>matter is a bit strange. Per definition, DOS filenames are <br>case insensitive. They are stored in upercase in the dorectory <br>but I am sure I open my files with a lowercase filename given <br>and the functions definitively find the right file and open <br>and read/write it. <br><br>Could this be a problem on the MAC side?<br><br>I don't know, if the patches will make it into the next <br>release, we had a discussion with Joel about it. I think they <br>will not break anything that was working without the <br>patches...<br><br>wkr,<br> Thomas.<br><br><br></pre>
<blockquote type="cite">
<pre wrap="">I also modified so I wrote a binary stream from 0x00 to 0xFF and tested <br>that it was uncorrupted. That worked fine too.<br><br>So effectively, this is working fine for me.<br><br>Do you know whether this will be included in the next snapshot?<br><br><br><br>Thomas Doerfler wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Hello,<br><br>no it has nothing to do with ada, it is a web-<br>based bug tracking system. Just try it out, <br>login/password is guest/guest...<br><br>wkr,<br> Thomas.<br><br><br></pre>
<blockquote type="cite">
<pre wrap="">Is the gnats system only ada? I am using C/C++, so will I be able to use <br>these?<br><br>Thomas Doerfler wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Hello Angelo,<br><br>the "sample" program is located in the patch filed in the gnat <br>system as PR369. So if you go to <br><br><a class="moz-txt-link-freetext" href="http://www.oarcorp.com/cgi-bin/gnatsweb.pl">http://www.oarcorp.com/cgi-bin/gnatsweb.pl</a><br><br>and inspect PR369 and download/apply the patch and then look <br>into c/src/tests/samples/fileio, you will see the sample <br>application.<br><br>BTW, you will also need PR368 and PR367 to get everything <br>running (these PRs contain modifications for the DOSFS code <br>and added drivers for PC386 and MBX8xx).<br><br>wkr,<br> Thomas.<br><br></pre>
</blockquote>
<pre wrap="">-- <br>Angelo Fraietta<br><br>PO Box 859<br>Hamilton NSW 2303<br><br>Home Page<br><br><br><a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a><br><br>There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>There are those who seek knowledge to be known by others - that is VANITY<br>There are those who seek knowledge in order to serve - that is LOVE<br> Bernard of Clairvaux (1090 - 1153)<br><br><br><br></pre>
</blockquote>
<pre wrap="">--------------------------------------------<br>IMD Ingenieurbuero fuer Microcomputertechnik<br>Thomas Doerfler Herbststrasse 8<br>D-82178 Puchheim Germany<br>email: <a class="moz-txt-link-abbreviated" href="mailto:Thomas.Doerfler@imd-systems.de">Thomas.Doerfler@imd-systems.de</a><br>PGP public key available at: <a class="moz-txt-link-freetext" href="http://www.imd">http://www.imd</a>-<br>systems.de/pgp_keys.htm<br><br><br></pre>
</blockquote>
<pre wrap="">-- <br>Angelo Fraietta<br><br>PO Box 859<br>Hamilton NSW 2303<br><br>Home Page<br><br><br><a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a><br><br>There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>There are those who seek knowledge to be known by others - that is VANITY<br>There are those who seek knowledge in order to serve - that is LOVE<br> Bernard of Clairvaux (1090 - 1153)<br><br><br><br></pre>
</blockquote>
<pre wrap=""><!----><br>--------------------------------------------<br>IMD Ingenieurbuero fuer Microcomputertechnik<br>Thomas Doerfler Herbststrasse 8<br>D-82178 Puchheim Germany<br>email: <a class="moz-txt-link-abbreviated" href="mailto:Thomas.Doerfler@imd-systems.de">Thomas.Doerfler@imd-systems.de</a><br>PGP public key available at: <a class="moz-txt-link-freetext" href="http://www.imd">http://www.imd</a>-<br>systems.de/pgp_keys.htm<br><br><br></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">-- <br>Angelo Fraietta<br><br>PO Box 859<br>Hamilton NSW 2303<br><br>Home Page<br><br><br><a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a><br><br>There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>There are those who seek knowledge to be known by others - that is VANITY<br>There are those who seek knowledge in order to serve - that is LOVE<br> Bernard of Clairvaux (1090 - 1153)</pre>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">--
Angelo Fraietta
PO Box 859
Hamilton NSW 2303
Home Page
<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>
There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
Bernard of Clairvaux (1090 - 1153)</pre>
<br>
</body>
</html>