<br><br><div class="gmail_quote">On Tue, May 28, 2013 at 7:35 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> I have managed to get it working buy using LD_PRELOAD=./vsipreload.so<br>
<br>
</div>Yes for some strange reason, some systems require the ./ and some not... My<br>
old Ubuntu 10.04 does no, but Travis on Ubuntu 12.04 does. Perhaps some<br>
security measure that has been added in LD_PRELOAD mechanism.<br>
<br>
I've just adjusted the examples in the .cpp header to add ./<br>
<br>
><br>
> e.g.<br>
> LD_PRELOAD=./vsipreload.so gdalinfo /vsicurl/<br>
<div class="im">> <a href="http://download.osgeo.org/gdal/data/netcdf/utm-big-chunks.nc" target="_blank">http://download.osgeo.org/gdal/data/netcdf/utm-big-chunks.nc</a><br>
><br>
> It seems that setting LD_PRELOAD outside of the command works also, so this<br>
> mechanism would be used transparently.<br>
> But does it have a significant overhead and/or chances it might do damage<br>
> if always set?<br>
<br>
</div>This should have no impact for I/O on regular files, except for a hopefully<br>
small performance hit to check if the FILE* is a regular one (and redirect to<br>
the glibc function) or one that is a VSILFILE* instead (and redirect to VSI<br>
implementation). On /vsiXXXX files, crashes are theoretically possible if a<br>
glibc function using the fake FILE* is used, but not overloaded in the .so.<br>
<br>
><br>
> e.g.<br>
> export LD_PRELOAD=./vsipreload.so<br>
> gdalinfo /vsicurl/<br>
<div class="im">> <a href="http://download.osgeo.org/gdal/data/netcdf/utm-big-chunks.nc" target="_blank">http://download.osgeo.org/gdal/data/netcdf/utm-big-chunks.nc</a><br>
><br>
><br>
> Is there any way this could be integrated into gdal to transparently<br>
> support vsifile for all drivers, without setting LD_PRELOAD?<br>
<br>
</div>None that I'm aware of. LD_PRELOAD is really something that must be specified<br>
before process launching. When GDAL code is reached, it is too late (and those<br>
limitations are really welcome for obvious security reasons).<br></blockquote><div><br></div><div>It would probably best (and safer for the time being) to use aliases for commonly-used apps that would benefit from this (gdal*, qgis, etc) </div>
<div><br></div><div><div>alias gdalinfo='LD_PRELOAD=/usr/local/lib/vsipreload.so gdalinfo'</div><div></div><div>alias gdalwarp='LD_PRELOAD=/usr/local/lib/vsipreload.so gdalwarp'</div><div></div><div>alias qgis='LD_PRELOAD='usr/local/lib/vsipreload.so qgis'</div>
</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> In this way this feature would be available to all gdal commands or even<br>
> other apps that use gdal.<br>
><br>
> For example, /vsizip/ is used in QGIS, but it does not work with certain<br>
> files (e.g. netcdf ) inside archives. But if I use LD_PRELOAD it works for<br>
> netcdf files! Neat stuff!<br>
> e.g. LD_PRELOAD=./vsipreload.so qgis<br>
<br>
</div>As I mentioned in another post in that thread, the use of a fuse filesystem<br>
could make it less hackish, although you would need permissions to mount on<br>
/vsizip , /vsicurl etc which might be problematic if you are not a good friend<br>
with the system administrator. You don't need to be root to mount a fuse<br>
filesystem, but you must have write permissions on the mount point I believe.<br></blockquote><div><br></div><div>it seems a little more involved and less flexible</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> great work<br>
> Etienne<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</div></div></blockquote></div><br>