Ignore:
Timestamp:
Jun 26, 2006, 1:12:48 PM (18 years ago)
Author:
bcornec
Message:

Attempt to fix Bug #7820 Does not backup a file greater than 2 GB
Report from taps23@…
Changed legnth_of_file to off_t for ftello support and all relative changes made as well in various functions to be consistent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/libmondo-files.c

    r681 r684  
    596596 * @return The length of the file, or -1 for error.
    597597 */
    598 long long length_of_file(char *filename)
     598off_t length_of_file(char *filename)
    599599{
    600600    /*@ pointers *************************************************** */
     
    602602
    603603    /*@ long long ************************************************* */
    604     long long length;
     604    off_t length;
    605605
    606606    fin = fopen(filename, "r");
     
    611611    }
    612612    fseeko(fin, 0, SEEK_END);
    613     length = ftell(fin);
     613    length = ftello(fin);
    614614    paranoid_fclose(fin);
    615615    return (length);
     
    641641
    642642    /*@ long [long] ************************************************* */
    643     long long filelist_length;
    644     long curr_pos;
     643    off_t filelist_length;
     644    off_t curr_pos;
    645645    long start_time;
    646646    long current_time;
     
    680680            counter = 0;
    681681            curr_fname[37] = '\0';
    682             curr_pos = ftell(fin) / 1024;
     682            curr_pos = ftello(fin) / 1024;
    683683            percentage = (int) (curr_pos * 100 / filelist_length);
    684684            time_taken = current_time - start_time;
     
    921921                }
    922922            } else {
     923                /* BERLIOS: more than long here ??? */
    923924                file_len_K = (long) (length_of_file(fname) / 1024);
    924925            }
Note: See TracChangeset for help on using the changeset viewer.