Changeset 29 for trunk/src


Ignore:
Timestamp:
Jul 20, 2005 6:11:12 AM (16 years ago)
Author:
dkearney
Message:

took my own advise and transfered the file opening text to the c api, which is used by the fortran api.

dsk - 20050720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fortran/rappture_fortran.c

    r27 r29  
    320320    char* inFilePath = NULL;
    321321
    322     long int fileLength = 0;
    323     char* fileContents = NULL;
    324     FILE* fp = NULL;
    325 
    326322    if (!rapptureStarted) {
    327323        rp_init();
    328324    }
    329325
    330 
    331326    inFilePath = null_terminate((char*)filePath, filePath_len);
    332327   
     
    338333    if (rpClass) {
    339334
    340         fp = fopen(inFilePath,"rb");
    341         if (fp) {
    342             fseek(fp, 0, SEEK_END);
    343             fileLength = ftell(fp);
    344             rewind(fp);
    345         }
    346         fileContents = (char*) calloc(fileLength,sizeof(char));
    347         fread((void*)fileContents,sizeof(char),fileLength,fp);
    348335
    349336        // create a RapptureIO object and store in dictionary
    350         // lib = createRapptureObj(rpClass, inFilePath);
    351         lib = createRapptureObj(rpClass, fileContents);
     337        lib = createRapptureObj(rpClass, inFilePath);
    352338
    353339        if (lib) {
Note: See TracChangeset for help on using the changeset viewer.