2010/2/14 Lukas Renggli <renggli@gmail.com>:
hi Colin
I guess he missed that, so let me answer.
Is there a way not to have to specify the FileSystem to create a stream for a file on disk?
str := FSUnixFilesystem new writeStreamOn: 'giffle'. str nextPutAll: 'zzzzzzzzzz'. str close
->
str := 'giffle' asWriteStream str nextPutAll: 'zzzzzzzzzz'. str close
First of all you should not hardcode the unix platform. Instead let the system resolve the platform for you:
 (FSDiskFilesystem current / 'griffle') writeStream
At the moment there is no shortcut for this on String. I think it would make sense to add a method #asFilesystemReference that would try to guess the right filesystem and answer a reference. So then one could write:
 'griffle' asFilesystemReference writeStream  'http://www.lukas-renggli.ch' asFilesystemReference readStream  ...
Do we really reference the file-system or just a file ? asFileReference or asFilename (VW) would be just fine to my own taste. Nicolas
currentFolder doWithAllFiles: [:each | Transcript show: each name ; show: each size ; cr]
 currentFolder allChildren do: [ :each |
Do I have to use an FSPreOrderGuide? Are there some behavior like doWithAllFiles already defined?
Yes, in the enumeration protocol of FSReference. There are only a few algorithms there, but that will probably grow over time. The FSPreOrderGuide is an internal implementation artifact, it should not be used directly.
Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project