Alternative directory/file classes?

Bert Freudenberg bert at freudenbergs.de
Mon Mar 12 13:47:17 UTC 2007


On Mar 12, 2007, at 14:12 , Keith Hodges wrote:

> Bert Freudenberg wrote:
>>
>> Well, I wouldn't call it a refactoring - it's not meant to replace  
>> the "real" directory classes, is it?
> Dear Bert,
>
> it most definitely IS meant to replace the "real" directory  
> classes. A quote from the class comment:
>
>    "A Rio is an experimental version of ruby's rio in smalltalk, so  
> as to compare with other     approaches such as Fileman, the  
> intention being to murder FileDirectory!"

Cool. Rio in Ruby appears to be just a convenience library, so excuse  
my misunderstanding.

> building on a base with lots of methods. If you begin from scratch,  
> it turns out that most of the interesting functionality is layered  
> on top of one method. (currently called #on:recusively:select:)

Well, FileDirectory perhaps does too much, hence a lot of code. The  
"interesting" functionally would have to be defined. One non-obvious  
functionality is that it is polymorphic with ServerDirectory. That's  
the foundation why tools like FileList work on files as well as  
remote locations transparently. I'd expect the same from a replacement.

In any case, if this is not just a convenience wrapper, I'd certainly  
give it an intention-revealing name in best Smalltalk tradition  
rather than an arbitrary fantasy name.

> Unfortunately I do not have access to a windows machine at the  
> moment so I may need some help to make this fly.

Cross-platform file support has been a real pain in the past, mostly  
because users usually only develop on one platform and unconsciously  
use platform-dependent strings for filenames. I've been working with  
the URI package lately (http://www.squeaksource.com/URI.html) which  
is a real pleasure because it just does the Right Thing when taking  
your code from one platform to the next.

- Bert -





More information about the Squeak-dev mailing list