Some comments about Filesystem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Some comments about Filesystem

Alexandre Bergel
Some comments about Filesystem:

I am trying to use your library for file processing. I had the  
following:
(FileStream fileNamed: 'inc.c.xml' ) readStream next
=> $<

With Filesystem, I obtain the following:
(FSDiskFilesystem current referenceTo: 'inc.c.xml') readStream next
=> 60

The problem is that the XML library does the #next, which expects a  
character, and not integer. I do instead:
        (FSDiskFilesystem current referenceTo: filenameString) readStreamDo:  
[:stream | .
                document := self parse: (ReadStream on: stream contents asString).
                ...
But there should be a nicer way to obtain a character stream from a  
file.


Another comment, why not to have FSReference>>files and  
FSReference>>directories? Although the visitors are convenient, I feel  
it will be useful to add #files and #directories.

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Some comments about Filesystem

Stéphane Ducasse
I'm not sure that colin reads the pharo mailing-list.

Stef

On Nov 24, 2009, at 4:19 PM, Alexandre Bergel wrote:

> Some comments about Filesystem:
>
> I am trying to use your library for file processing. I had the  
> following:
> (FileStream fileNamed: 'inc.c.xml' ) readStream next
> => $<
>
> With Filesystem, I obtain the following:
> (FSDiskFilesystem current referenceTo: 'inc.c.xml') readStream next
> => 60
>
> The problem is that the XML library does the #next, which expects a  
> character, and not integer. I do instead:
> (FSDiskFilesystem current referenceTo: filenameString) readStreamDo:  
> [:stream | .
> document := self parse: (ReadStream on: stream contents asString).
> ...
> But there should be a nicer way to obtain a character stream from a  
> file.
>
>
> Another comment, why not to have FSReference>>files and  
> FSReference>>directories? Although the visitors are convenient, I feel  
> it will be useful to add #files and #directories.
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project