[Q][Smalltalk][Bug?] Assuring the existence of a path

David T. Lewis lewis at mail.msen.com
Sat Mar 16 14:04:12 UTC 2002


On Fri, Mar 15, 2002 at 02:36:52PM +0100, Hannes Hirzel wrote:
> 
> I like to access a directory which is a neighbour of the directory
>     FileDirectory default
> 
> while at the same time making sure that it exists:
> 
> I use
> 
>    upperDir _ FileDirectory default containingDirectory.
>    delim _  FileDirectory pathNameDelimiter asString.
>    upperDir assureExistenceOfPath: (upperDir pathName, delim, 'cmaps' ,
>    delim , 'smtk').
> 
> 
> What am I missing? Or is this a bug?

Use FileDirectory class>>slash as the delimiter.
Use FileDirectory>>directoryExists: to make sure the directory exists.

Dave
 



More information about the Squeak-dev mailing list