Is there file reading max size limitation using ms-dos file system ?

Thomas Kim thomas73.kim at gmail.com
Tue Jan 13 06:51:04 UTC 2015


Dear Joel,

I had a mistake in my code for mounting file system.

Thank you.

Best Regards,
Thomas

2015-01-13 2:59 GMT+09:00 Joel Sherrill <joel.sherrill at oarcorp.com>:

>
> On 1/12/2015 3:59 AM, Thomas Kim wrote:
>
> Dear Sir,
>
>  I am testing standard File I/O on ms-dos file system.
> also, 19MB file(testfile.bin) is included on 32MB ms-dos file storage.
>
>   Out of curiousity, what is the sector size of the 32MB file system?
> Is it FAT16 or FAT32?
>
> FAT12 has a limit of 12MB per the URL below so I wondering if it is
> related to that. Your value is ~1/2 that.
>
>
> 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
>
>  There is two example for testing fread().
>
>  Case 1: Normal
>    FILE * fp_in;
>         void *buffer;
>  fp_in = fopen("/mnt/file/testfile.bin", "rb");
>  buffer = malloc(0x800000); // 8MB
>  printf("4MB size:%d\n", fread(buffer, 1, 0x400000, fp_in)); // 4MB
> reading
>  free(buffer);
>  fclose(fp_in);
>
>  Case 2: Abnormal
>   FILE * fp_in;
>         void *buffer;
>  fp_in = fopen("/mnt/file/testfile.bin", "rb");
>  buffer = malloc(0x800000); // 8MB
>  printf("8MB size:%d\n", fread(buffer, 1, 0x200000, fp_in)); // 8MB
> reading
>  free(buffer);
>  fclose(fp_in);
>
>  Output of case 1 : 4MB size:4194304  ==> OK
> Output of case 2 : 8MB size:6590976  ==> FAIL (Wanted value = 8388608)
>
>  I guess that fread() function have a limitation for reading file reading
> size.
>
>  Please let me know how to increase max file size using fread() function.
>
>  Best Regards,
> Thomas Kim
>
>
>
> --
> Joel Sherrill, Ph.D.             Director of Research & Developmentjoel.sherrill at OARcorp.com        On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
> Support Available                (256) 722-9985
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20150113/8bfa2145/attachment.html>


More information about the users mailing list