<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Thanks for pointing me right at the vrt readlink changeset.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
This re-arrangement of files is done without me or gdal doing anything.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"># readonly filesystem with data used by tests. Note that the checksums are different directories</div>
<span style="font-family:arial,sans-serif;font-size:13px">/data/checksum1/a.vrt</span><div style="font-family:arial,sans-serif;font-size:13px">/data/checksum2/small.raw</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"># each test gets it's own working area</div><div style="font-family:arial,sans-serif;font-size:13px">/ramdrive/test1234/a.vrt -> /data/checksum1/a.vrt</div>
<div style="font-family:arial,sans-serif;font-size:13px">/ramdrive/test1234/small.raw -> /data/checksum2/small.raw</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
The test is then given /ramdrive/test1234/a.vrt</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">As for the config options, I was trying to think out loud if a config option needed to be added to allow switching of readlink behavior in <span style="color:rgb(80,0,80)">vrtdataset.cpp. </span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 6, 2014 at 10:56 AM, 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">Hi Kurt,<br>
<div class="im"><br>
><br>
> I ran into trouble with readlink as can be seen in<br>
> <a href="http://trac.osgeo.org/gdal/ticket/5340" target="_blank">http://trac.osgeo.org/gdal/ticket/5340</a>. I'm working with a system where<br>
> the run directory is all symbolic links. So if I have nonsquare.vrt<br>
> refering to "./small.raw", readlink of nonsquare.vrt will end up being in a<br>
> totally different directory than the small.raw file.<br>
><br>
> So... That begs the question of the purpose of dereferencing symbolic links<br>
> using readlink (e.g.<br>
> <a href="http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/vrt/vrtdataset.cpp#L687" target="_blank">http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/vrt/vrtdataset.cpp#L687</a><br>
> ). Is this done just for performance on filesystems where symbolic links<br>
> might be a performance hit (e.g. nfs file systems over slow networks and<br>
> an OS that does not do a good job caching)? Or is there something else<br>
> important that I'm missing?<br>
<br>
</div>This was added in <a href="http://trac.osgeo.org/gdal/changeset/25682" target="_blank">http://trac.osgeo.org/gdal/changeset/25682</a> . The autotests<br>
added in that commit show the use cases that are solved. They seem to be<br>
rather reasonable.<br>
<br>
I'm having trouble to understand your use case that doesn't work. Perhaps you<br>
could explain it in a more "graphical" way ( "ls -al" in the relevant<br>
directories will do )<br>
<div class="im"><br>
><br>
> I see 4 places where readlink is used:<br>
><br>
> ./ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp: int nBytes =<br>
> readlink(pszName, szPointerFilename, sizeof(szPointerFilename));<br>
> ./gcore/gdalopeninfo.cpp: int nBytes = readlink(pszFilename,<br>
> szPointerFilename, sizeof(szPointerFilename));<br>
> ./port/cpl_getexecpath.cpp: nResultLen = readlink( osExeLink,<br>
> pszPathBuf, nMaxLength );<br>
> ./frmts/vrt/vrtdataset.cpp: int bufferSize =<br>
> readlink(currentVrtFilename, filenameBuffer, sizeof(filenameBuffer));<br>
><br>
> ogrsfdriverregistar.cpp looks like a possible issue.<br>
><br>
> <a href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/generic/ogrsf" target="_blank">http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/generic/ogrsf</a><br>
> driverregistrar.cpp#L250<br>
><br>
> I see that sort of works...<br>
><br>
> ogrinfo my_remote_poly.shp<br>
> ERROR 4: Unable to open /vsicurl/<br>
> <a href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp" target="_blank">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp</a> or /vsicurl/<br>
> <a href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.SHP" target="_blank">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.SHP</a>.<br>
> Had to open data source read-only.<br>
> INFO: Open of `my_remote_poly.shp'<br>
> using driver `ESRI Shapefile' successful.<br>
> INFO: Internal data source name `/vsicurl/<br>
> <a href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp" target="_blank">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp</a>'<br>
> different from user name `my_remote_poly.shp'.<br>
> 1: poly (3D Polygon)<br>
<br>
</div>Yes this is convenient to be able to "ln -s /vsicurl/<a href="http://somethnig" target="_blank">http://somethnig</a>" to<br>
something.<br>
<div class="im"><br>
><br>
> I'm thinking that I should just disable readlink entirely. Alternatively,<br>
> hhould there be a flag that controls readlink just for working with vrt's<br>
> or a runtime ConfigSetting that could turn on/off readlink?<br>
<br>
</div>No there's no such runtime configuration option.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Any thoughts would be appreciated!<br>
><br>
> Thanks,<br>
> -kurt<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<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>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div>
</div>