<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 1/12/2015 3:59 AM, Thomas Kim wrote:<br>
</div>
<blockquote
cite="mid:CADY8aTBUeZtGy7VF2E8SJUydo-GTVx3xPLqsAr3y6x4abhxosw@mail.gmail.com"
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 class="moz-txt-link-freetext" 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">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
cite="mid:CADY8aTBUeZtGy7VF2E8SJUydo-GTVx3xPLqsAr3y6x4abhxosw@mail.gmail.com"
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 class="" style="white-space:pre"> </span>FILE
* fp_in;</div>
<div> void *buffer;</div>
<div><span class="" style="white-space:pre"> </span>fp_in
= fopen("/mnt/file/testfile.bin", "rb");</div>
<div><span class="" style="white-space:pre"> </span>buffer
= malloc(0x800000); // 8MB<br>
</div>
<div><span class="" style="white-space:pre"> </span>printf("4MB
size:%d\n", fread(buffer, 1, 0x400000, fp_in)); // 4MB
reading<br>
</div>
<div><span class="" style="white-space:pre"> </span>free(buffer);<br>
</div>
<div><span class="" style="white-space:pre"> </span>fclose(fp_in);</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div>Case 2: Abnormal</div>
<div>
<div>
<div><span class="" style="white-space:pre"> </span>FILE *
fp_in;</div>
<div> void *buffer;</div>
<div><span class="" style="white-space:pre"> </span>fp_in =
fopen("/mnt/file/testfile.bin", "rb");</div>
<div><span class="" style="white-space:pre"> </span>buffer
= malloc(0x800000); // 8MB<br>
</div>
<div><span class="" style="white-space:pre"> </span>printf("8MB
size:%d\n", fread(buffer, 1, 0x200000, fp_in)); // 8MB
reading<br>
</div>
<div><span class="" style="white-space:pre"> </span>free(buffer);<br>
</div>
<div><span class="" style="white-space:pre"> </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> <br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">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>
</body>
</html>