<br><br><div class="gmail_quote">On Wed, Sep 22, 2010 at 3:45 PM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Ok, so what does the cog vm answer? </div></blockquote><div><br></div><div>You mean in the dangling link case, right? Important to state the context. </div><div><br></div><div>What the unix VM answers, which IMO is wrong.  i.e. in both platforms//unix/plugins/FilePlugin/sqUnixFile.c and platforms//Mac OS/plugins/FilePlugin/sqMacUnixFileInterface.c dir_EntryLookup includes:</div>
<div><br></div><div><div>  if (stat(unixPath, &amp;statBuf) &amp;&amp; lstat(unixPath, &amp;statBuf)) {</div><div>    return NO_MORE_ENTRIES;</div><div>  }</div><div><br></div><div>  /* To match the results of dir_Lookup, copy back the file name */</div>
<div>  *nameLength = ux2sqPath(nameString, nameStringLength, name, 256, 0);</div><div><br></div><div>  /* last change time */</div><div>  *creationDate= convertToSqueakTime(statBuf.st_ctime);</div><div>  /* modification time */</div>
<div>  *modificationDate= convertToSqueakTime(statBuf.st_mtime);</div></div><div> ...</div><div><br></div><div>So if the stat fails and lstat succeeds the code answers the info for the link.  It should read something like</div>
<div><br></div><div><div>  if (stat(unixPath, &amp;statBuf)) {</div><div>      /* If we can lstat the entry exists, but we have no information for the entry&#39;s target so answer a zero date, size, et al */</div><div>      if (lstat(unixPath, &amp;statBuf))</div>
</div><div>           return NO_MORE_ENTRIES;</div><div>      memset(&amp;statBuf, 0, sizeof(statBuf));</div><div>  }</div><div>  ...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div>I see that the unix command line says </div><div><div class="im"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><span style="font-family:arial, sans-serif;font-size:12px"><pre style="font-size:12px;white-space:pre-wrap;overflow-x:hidden;overflow-y:hidden;padding-left:0.7em">12B Sep 20 16:31 /tmp/bar.txt </pre>
</span></div></div></blockquote></div></blockquote><div><br></div></div><div>which is the meta-data for the alias file, not the target</div><div><div></div><div class="h5"><div><br></div><div><br></div><div><div>On 2010-09-22, at 1:52 PM, Eliot Miranda wrote:</div>
<br><blockquote type="cite"><br><br><div class="gmail_quote">On Wed, Sep 22, 2010 at 1:01 PM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Although the behaviour aspect is a concern. <div><br></div><div>IE open the target file, rename only the alias, delete only the alias. </div><div><br></div><div>The question was more what should I return for the alias create, mod, and file size.  </div>

<div>The data from the alias file, or the data from the target file. </div><div><br></div><div>My point was in OS-X, aka unix like operating systems it returns the meta-data from the alias file. </div></div></blockquote>
<div>
<br></div><div>It should answer the metadata for the target.  Answering the metadata for the link/alias should require special action.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div>The complaint was under Carbon OS-9 it would return the meta-data from the target file, so the behaviour is different. </div></div></blockquote><div><br></div><div>The Carbon behavior is IMO correct.  For symbolic links to behave like transparent links systems need to hide their existence when interacting with the file system in a conventional manner.  Not doing so renders symbolic links useless.  It is useful to be able to see symbolic links and aliases and so it is useful to add unconventional means to discover thise links/aliases. But for the links to function like links Squeak should indirect through them conventionally.</div>

<div><br></div><div>best</div><div>Eliot</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div>
<div><br></div><div><br><div><div>On 2010-09-21, at 11:13 PM, Eliot Miranda wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">On Tue, Sep 21, 2010 at 10:33 PM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 <br><div style="word-wrap:break-word">Ok, well someone needs to decide what the acceptable behaviour is.</div></blockquote><div><br></div><div>If attempting to ope the link opens the target then (of course) the acceptable behaviour is to show the size of the target. In Unix one has to take special action to see the link (use a special argument to ls, use lstat, use readlink, etc).  Likewise with the VM all standard operations should follow the link and special action be required to see the link.  Links without targets are a grey area in which I think it better to fail safe.  e.g. the size of a targetless link should be 0, not the size of the link.  An attempt to open a targetless link will not answer the link itself (fopen in the standard FilePlugin implementation will answer an error), so answering the size of the link is inconsistent with the implementation of the FilePlugin.</div>


<div><br></div><div>2˘</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div><span style="font-family:arial, sans-serif;font-size:12px"><pre style="font-size:12px;white-space:pre-wrap;overflow-x:hidden;overflow-y:hidden;padding-left:0.7em">
$ ls -lah /tmp/*.txt
lrwxr-xr-x  1 sven  wheel    12B Sep 20 16:31 /tmp/bar.txt -&gt; /tmp/foo.txt
-rw-r--r--  1 sven  wheel    36B Sep 20 16:30 /tmp/foo.txt
</pre><div><br></div><div><pre style="font-size:12px;white-space:pre-wrap;overflow-x:hidden;overflow-y:hidden;padding-left:0.7em">/tmp/bar.txt  is 12 bytes</pre><pre style="font-size:12px;white-space:pre-wrap;overflow-x:hidden;overflow-y:hidden;padding-left:0.7em">
/tmp/foo.txt  is 36  bytes</pre><pre style="font-size:12px;white-space:pre-wrap;overflow-x:hidden;overflow-y:hidden;padding-left:0.7em"><div><font face="arial, sans-serif"><span style="white-space:normal"><font face="monospace"><span style="white-space:pre-wrap"><br>


</span></font></span></font></div><div><font face="arial, sans-serif"><span style="white-space:normal"><font face="monospace"><span style="white-space:pre-wrap">We show that.... </span></font></span></font></div><div><br>


</div></pre></div></span></div><div><br><div><div>On 2010-09-20, at 8:18 AM, Mariano Martinez Peck wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Sven Van Caekenberghe</b> <span dir="ltr">&lt;<a href="mailto:sven@beta9.be" target="_blank">sven@beta9.be</a>&gt;</span><br>


Date: Mon, Sep 20, 2010 at 4:57 PM<br>
Subject: [Pharo-project] Issue 2982: DirectoryEntry on Cog VM OSX does not follow symlinks for determining file size<br>To: Pharo Development &lt;<a href="mailto:Pharo-project@lists.gforge.inria.fr" target="_blank">Pharo-project@lists.gforge.inria.fr</a>&gt;<br>



<br><br><a href="http://code.google.com/p/pharo/issues/?id=2982" target="_blank">http://code.google.com/p/pharo/issues/detail?id=2982</a><br>
<br>
Sven<br>
<br>
<br>
_______________________________________________<br>
Pharo-project mailing list<br>
<a href="mailto:Pharo-project@lists.gforge.inria.fr" target="_blank">Pharo-project@lists.gforge.inria.fr</a><br>
<a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
</div><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">


<font face="Helvetica" size="3">--</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:  squeaker68882</font></div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com/" target="_blank">http://www.smalltalkconsulting.com</a></font></div>


<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div><div><br></div></div>

</div>
</div></div></div></span></div></span><br></span><br>
</div>
<br></div></div><br></blockquote></div><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

<font face="Helvetica" size="3">--</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:  squeaker68882</font></div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com/" target="_blank">http://www.smalltalkconsulting.com</a></font></div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div><div><br></div></div>
</div>
</div></div></div></span></div></span><br></span><br>
</div>
<br></div></div></div></div></blockquote></div><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Helvetica" size="3">--</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:  squeaker68882</font></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" target="_blank">http://www.smalltalkconsulting.com</a></font></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3">===========================================================================</font></div><div><br></div></div></div>
</div></div></div></span></div></span><br></span><br>
</div>
<br></div></div></div></div></blockquote></div><br>