CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  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 offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,824

    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. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. 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/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  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
    677

    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
  •  





Click Here to Expand Forum to Full Width

Featured