[gdal-dev] What is readlink used for?
allenck at windstream.net
Tue Jan 7 12:28:17 PST 2014
298 W. Audubon Drive
Shepherdsville, KY 40165
+1 502 543-3438
On 01/06/2014 01:35 PM, Kurt Schwehr wrote:
> Hi all,
> I ran into trouble with readlink as can be seen in
> http://trac.osgeo.org/gdal/ticket/5340. I'm working with a system
> where the run directory is all symbolic links. So if I have
> nonsquare.vrt refering to "./small.raw", readlink of nonsquare.vrt
> will end up being in a totally different directory than the small.raw
> So... That begs the question of the purpose of dereferencing symbolic
> links using readlink (e.g.
> Is this done just for performance on filesystems where symbolic links
> might be a performance hit (e.g. nfs file systems over slow networks
> and an OS that does not do a good job caching)? Or is there something
> else important that I'm missing?
> I see 4 places where readlink is used:
> ./ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp: int nBytes =
> readlink(pszName, szPointerFilename, sizeof(szPointerFilename));
> ./gcore/gdalopeninfo.cpp: int nBytes = readlink(pszFilename,
> szPointerFilename, sizeof(szPointerFilename));
> ./port/cpl_getexecpath.cpp: nResultLen = readlink( osExeLink,
> pszPathBuf, nMaxLength );
> ./frmts/vrt/vrtdataset.cpp: int bufferSize =
> readlink(currentVrtFilename, filenameBuffer, sizeof(filenameBuffer));
> ogrsfdriverregistar.cpp looks like a possible issue.
> I see that sort of works...
> ogrinfo my_remote_poly.shp
> ERROR 4: Unable to open
> /vsicurl/http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp or
> Had to open data source read-only.
> INFO: Open of `my_remote_poly.shp'
> using driver `ESRI Shapefile' successful.
> INFO: Internal data source name
> different from user name `my_remote_poly.shp'.
> 1: poly (3D Polygon)
> I'm thinking that I should just disable readlink entirely.
> Alternatively, hhould there be a flag that controls readlink just for
> working with vrt's or a runtime ConfigSetting that could turn on/off
> Any thoughts would be appreciated!
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev