File could not be loaded due to size
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: File could not be loaded due to size

  1. #1
    Join Date
    Sep 2017
    Posts
    2

    File could not be loaded due to size

    Hi,
    I was using the C program to upload a file, while this month the file was little bigger which is above 2 GB and the program was not able to detect that file, where when i split the file into two it can able to show that and uploading,
    KIndly let me know any idea you have about this, and also let me know if any further information required??

    In this code i am getting the warning File NOT AVAILABLE with 2 GB file in the upload path

    Code:
    fp = fopen64(text_path, "r"); /* fopen64() for open a 64-bits (or) large file */
    /**-- warn if file is not present ---**/
    if (fp == NULL) {
         printf("File:%s NOT AVAILABLE\n", text_path);
    } else {
         /**--- else proceed with upload ----**/
         /** Let's check the header first **/
         head_check = get_head_info(text_path, db_files[ctr].date_pos, db_files[ctr].freq_pos, db_files[ctr].exp_date, db_files[ctr].exp_freq);
         switch (head_check) {
              case 0 : /** Mark as ok for upload**/
                   printf("File :%s\tDate:%s\tFrq.:%s -> ", db_files[ctr].file_name, db_files[ctr].exp_date, db_files[ctr].exp_freq);
                   if (normal_yn == 'S' || normal_yn == 's') {
                        mark = get_yes_no("OK to load :");
                   } else {
                        mark = 1;
                        printf("\b\b\bOK to Load :-> Y\n");
                   }
    
                   if(mark == 1)
                        strcpy(db_files[ctr].upload_y_n, "Y");
    
                   break;
    Last edited by 2kaud; September 6th, 2017 at 03:43 AM. Reason: Added code tags

  2. #2
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    5,707

    Re: File could not be loaded due to size

    This may help. See post #4 of this thread http://forums.codeguru.com/showthrea...pen-vs-fopen64
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.3.4)

  3. #3
    Join Date
    Sep 2017
    Posts
    2

    Re: File could not be loaded due to size

    Hi There is no issue in compiling but after that it is not detecting the file

  4. #4
    Join Date
    Feb 2017
    Posts
    147

    Re: File could not be loaded due to size

    Quote Originally Posted by kvraman03 View Post
    Hi There is no issue in compiling but after that it is not detecting the file
    Did you note entry #4 in the thread 2kaud referred to?

    Even though your program compiles it may not use the proper libraries. The compiler/linker may have to be explicitly instructed to include the right ones.
    Last edited by wolle; September 11th, 2017 at 02:29 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)