<div dir="ltr">Dear Joel,<div><br></div><div>I had a mistake in my code for mounting file system.</div><div><br></div><div>Thank you.</div><div><br></div><div>Best Regards,</div><div>Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-13 2:59 GMT+09:00 Joel Sherrill <span dir="ltr"><<a href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<br>
<div>On 1/12/2015 3:59 AM, Thomas Kim wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Dear Sir,
<div><br>
</div>
<div>I am testing standard File I/O on ms-dos file system.</div>
<div>also, 19MB file(testfile.bin) is included on 32MB ms-dos
file storage.<br>
</div>
<div><br>
</div>
</div>
</blockquote>
Out of curiousity, what is the sector size of the 32MB file system?<br>
Is it FAT16 or FAT32?<br>
<br>
FAT12 has a limit of 12MB per the URL below so I wondering if it is<br>
related to that. Your value is ~1/2 that.<br>
<br>
<a href="http://answers.microsoft.com/en-us/windows/forum/windows_7-files/what-is-the-maximum-file-size-fat-fat32-ntfs-file/1663db6b-490e-4021-9e36-f7a6976ac0c0" target="_blank">http://answers.microsoft.com/en-us/windows/forum/windows_7-files/what-is-the-maximum-file-size-fat-fat32-ntfs-file/1663db6b-490e-4021-9e36-f7a6976ac0c0</a><br>
<blockquote type="cite">
<div dir="ltr">
<div>There is two example for testing fread().</div>
<div><br>
</div>
<div>Case 1: Normal<br>
</div>
<div>
<div>
<div>
<div>
<div><span style="white-space:pre-wrap"> </span>FILE
* fp_in;</div>
<div> void *buffer;</div>
<div><span style="white-space:pre-wrap"> </span>fp_in
= fopen("/mnt/file/testfile.bin", "rb");</div>
<div><span style="white-space:pre-wrap"> </span>buffer
= malloc(0x800000); // 8MB<br>
</div>
<div><span style="white-space:pre-wrap"> </span>printf("4MB
size:%d\n", fread(buffer, 1, 0x400000, fp_in)); // 4MB
reading<br>
</div>
<div><span style="white-space:pre-wrap"> </span>free(buffer);<br>
</div>
<div><span style="white-space:pre-wrap"> </span>fclose(fp_in);</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div>Case 2: Abnormal</div>
<div>
<div>
<div><span style="white-space:pre-wrap"> </span>FILE *
fp_in;</div>
<div> void *buffer;</div>
<div><span style="white-space:pre-wrap"> </span>fp_in =
fopen("/mnt/file/testfile.bin", "rb");</div>
<div><span style="white-space:pre-wrap"> </span>buffer
= malloc(0x800000); // 8MB<br>
</div>
<div><span style="white-space:pre-wrap"> </span>printf("8MB
size:%d\n", fread(buffer, 1, 0x200000, fp_in)); // 8MB
reading<br>
</div>
<div><span style="white-space:pre-wrap"> </span>free(buffer);<br>
</div>
<div><span style="white-space:pre-wrap"> </span>fclose(fp_in);</div>
</div>
</div>
<div><br>
</div>
<div>Output of case 1 : 4MB size:4194304 ==> OK</div>
<div>Output of case 2 : 8MB size:6590976 ==> FAIL (Wanted
value = 8388608)</div>
<div><br>
</div>
<div>I guess that fread() function have a limitation for reading
file reading size.</div>
<div><br>
</div>
<div>Please let me know how to increase max file size using
fread() function.</div>
<div><br>
</div>
<div>Best Regards,</div>
<div>Thomas Kim </div>
<div> <span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a href="mailto:joel.sherrill@OARcorp.com" target="_blank">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</font></span></div>
</blockquote></div><br></div>