Ignore:
Timestamp:
May 29, 2015, 1:31:23 PM (9 years ago)
Author:
djay
Message:

Migrate readVSIFile from server_internal to zoo_service shared library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/server_internal.c

    r642 r649  
    2828#ifndef WIN32
    2929#include <dlfcn.h>
    30 #endif
    31 
    32 #ifdef USE_MS
    33 #include "service_internal_ms.h"
    34 #else
    35 #include "cpl_vsi.h"
    3630#endif
    3731
     
    767761}
    768762
    769 /**
    770  * Read a file using the GDAL VSI API
    771  *
    772  * @param conf the maps containing the settings of the main.cfg file
    773  * @param dataSource the datasource name to read
    774  * @warning make sure to free ressources returned by this function
    775  */
    776 char *readVSIFile(maps* conf,const char* dataSource){
    777     VSILFILE * fichier=VSIFOpenL(dataSource,"rb");
    778     VSIStatBufL file_status;
    779     VSIStatL(dataSource, &file_status);
    780     if(fichier==NULL){
    781       char tmp[1024];
    782       sprintf(tmp,"Failed to open file %s for reading purpose. File seems empty %lld.",
    783               dataSource,file_status.st_size);
    784       setMapInMaps(conf,"lenv","message",tmp);
    785       return NULL;
    786     }
    787     char *res1=(char *)malloc(file_status.st_size*sizeof(char));
    788     VSIFReadL(res1,1,file_status.st_size*sizeof(char),fichier);
    789     res1[file_status.st_size-1]=0;
    790     VSIFCloseL(fichier);
    791     VSIUnlink(dataSource);
    792     return res1;
    793 }
    794 
    795 
     763
     764
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png