Of course I should have written<div><br></div><div><div>UnixFileDirectory default directoryExists: UnixFileDirectory default fullName, &#39;/.&#39;</div><div><br></div><div>But same problem applies...</div><br><div class="gmail_quote">
On Thu, Dec 15, 2011 at 2:19 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<div><br></div><div>    just noticed that</div><div><br></div><div>        UnixFileDirectory default directoryExists: UnixFileDirectory default asString, &#39;/.&#39;</div><div><br></div><div>answers false, since directoryNames excludes &#39;.&#39; and &#39;..&#39; (justifiable, and changing this might break all manner of things). i.e.</div>

<div><br></div><div>FileDirectory&gt;directoryExists: filenameOrPath</div><div><span style="white-space:pre-wrap">        </span>&quot;Answer true if a directory of the given name exists. The given name may be either a full path name or a local directory within this directory.&quot;</div>

<div><span style="white-space:pre-wrap">        </span>&quot;FileDirectory default directoryExists: FileDirectory default pathName&quot;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>| fName dir |</div>
<div><span style="white-space:pre-wrap">        </span>DirectoryClass splitName: filenameOrPath to:</div><div><span style="white-space:pre-wrap">                </span>[:filePath :name |</div><div><span style="white-space:pre-wrap">                        </span>fName := name.</div>

<div><span style="white-space:pre-wrap">                        </span>filePath isEmpty</div><div><span style="white-space:pre-wrap">                                </span>ifTrue: [dir := self]</div><div><span style="white-space:pre-wrap">                                </span>ifFalse: [dir := self directoryNamed: filePath]].</div>

<div><br></div><div><span style="white-space:pre-wrap">        </span>^dir exists and: [</div><div><span style="white-space:pre-wrap">                </span>self isCaseSensitive </div><div><span style="white-space:pre-wrap">                        </span>ifTrue:[dir directoryNames includes: fName]</div>

<div><span style="white-space:pre-wrap">                        </span>ifFalse:[dir directoryNames anySatisfy: [:name| name sameAs: fName]]].</div><div><br></div><div><br></div><div>So how about</div><div><br></div><div>FileDirectory class methods for accessing</div>

<div>currentDirectoryNickname</div><div>    ^&#39;.&#39;</div><div><br></div><div><div>FileDirectory&gt;directoryExists: filenameOrPath</div><div><span style="white-space:pre-wrap">        </span>&quot;Answer true if a directory of the given name exists. The given name may be either a full path name or a local directory within this directory.&quot;</div>

<div><span style="white-space:pre-wrap">        </span>&quot;FileDirectory default directoryExists: FileDirectory default pathName&quot;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>| fName dir |</div>
<div><span style="white-space:pre-wrap">        </span>DirectoryClass splitName: filenameOrPath to:</div><div><span style="white-space:pre-wrap">                </span>[:filePath :name |</div><div><span style="white-space:pre-wrap">                        </span>fName := name.</div>

<div><span style="white-space:pre-wrap">                        </span>filePath isEmpty</div><div><span style="white-space:pre-wrap">                                </span>ifTrue: [dir := self]</div><div><span style="white-space:pre-wrap">                                </span>ifFalse: [dir := self directoryNamed: filePath]].</div>

<div><br></div><div><span style="white-space:pre-wrap">        </span>^dir exists</div><div><span style="white-space:pre-wrap">        </span>and: [fName = self class currentDirectoryNickname</div><div>
<span style="white-space:pre-wrap">        </span><span style="white-space:pre-wrap">        </span>or: [self isCaseSensitive </div><div><span style="white-space:pre-wrap">                        </span>ifTrue:[dir directoryNames includes: fName]</div>
<div><span style="white-space:pre-wrap">                        </span>ifFalse:[dir directoryNames anySatisfy: [:name| name sameAs: fName]]]]</div><div><br></div><font color="#888888">-- <br>best,<div>Eliot</div><br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>
</div>