<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      <div class="moz-signature">
        <div class="moz-signature">
          <h2><font color="#009933">Allen Kempe</font></h2>
          <span> <a href="http://acksoft.dyndns.biz/PictureGallery"
              rel="nofollow" target="_blank">http://acksoft.dyndns.biz/PictureGallery</a></span><br>
          <font color="#000000">298 W. Audubon Drive<br>
            Shepherdsville, KY 40165<br>
            +1 502 543-3438<br>
          </font> </div>
      </div>
      On 01/06/2014 01:35 PM, Kurt Schwehr wrote:<br>
    </div>
    <blockquote
cite="mid:CACmBxytHMD6SrBh4Yhg+uYu0onNDQg5i5X8=QgOs2nxe3owqYQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div>I ran into trouble with readlink as can be seen in <a
            moz-do-not-send="true"
            href="http://trac.osgeo.org/gdal/ticket/5340">http://trac.osgeo.org/gdal/ticket/5340</a>.
           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 file.</div>
        <div><br>
        </div>
        <div>So... That begs the question of the purpose of
          dereferencing symbolic links using readlink (e.g. <a
            moz-do-not-send="true"
href="http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/vrt/vrtdataset.cpp#L687">http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/vrt/vrtdataset.cpp#L687</a>).
           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?</div>
        <div><br>
        </div>
        <div>I see 4 places where readlink is used:</div>
        <div><br>
        </div>
        <div>
          <div>./ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp:      
             int nBytes = readlink(pszName, szPointerFilename,
            sizeof(szPointerFilename));</div>
          <div>./gcore/gdalopeninfo.cpp:        int nBytes =
            readlink(pszFilename, szPointerFilename,
            sizeof(szPointerFilename));</div>
          <div>./port/cpl_getexecpath.cpp:    nResultLen = readlink(
            osExeLink, pszPathBuf, nMaxLength );</div>
          <div>./frmts/vrt/vrtdataset.cpp:            int bufferSize =
            readlink(currentVrtFilename, filenameBuffer,
            sizeof(filenameBuffer));</div>
          <div><br>
          </div>
        </div>
        <div>ogrsfdriverregistar.cpp looks like a possible issue.</div>
        <div>
          <br>
        </div>
        <div><a moz-do-not-send="true"
href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp#L250">http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp#L250</a><br>
        </div>
        <div><br>
        </div>
        <div>I see that sort of works...</div>
        <div><br>
        </div>
        <div>
          <div>ogrinfo my_remote_poly.shp </div>
          <div>ERROR 4: Unable to open /vsicurl/<a
              moz-do-not-send="true"
              href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp</a>
            or /vsicurl/<a moz-do-not-send="true"
              href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.SHP">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.SHP</a>.</div>
          <div>Had to open data source read-only.</div>
          <div>INFO: Open of `my_remote_poly.shp'</div>
          <div>      using driver `ESRI Shapefile' successful.</div>
          <div>INFO: Internal data source name `/vsicurl/<a
              moz-do-not-send="true"
              href="http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp">http://svn.osgeo.org/gdal/trunk/autotest/ogr/data/poly.shp</a>'</div>
          <div>      different from user name `my_remote_poly.shp'.</div>
          <div>1: poly (3D Polygon)</div>
        </div>
        <div><br>
        </div>
        <div>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 readlink?</div>
        <div><br>
        </div>
        <div>Any thoughts would be appreciated!</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>-kurt</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>