What stops you copy and paste?

Using ANSI Smalltalk, you'd do
   [:stream | stream print: 1000 factorial; cr; close] value:
(FileStream write: 'factorial.txt'.
Pharo has never provided an ANSI-compatible FileStream class, which is
a pain for
trying to write portable code.  In Pharo you have to write
  'factorial.txt' asFileReference writeStreamDo: [:stream | stream
print: 1000 factorial; cr].


In Pharo 9, you'd have to change #write: to #newFileNamed:.
I wanted to check this in Pharo 12, but PharoLauncher has stopped working.

On Tue, 20 Feb 2024 at 20:46, Rene Paul Mages (ramix) <ph...@rmages.com> wrote:
>
> Hello Pharo Community,
>
> Output unix-redirection like the following is very useful :
>
> ls -al ./Pharo > Pharo-dir.txt
>
> <Help>
>
> I want to write in a file the "print-it" output of the following Pharo
> message :
>
>                          1000 factorial
>
> Please give me a good track.
>
> </Help>
>
>
> --
> All the best
> Rene Paul Mages (ramix) GnuPG key : 0x9840A6F7
> http://sites.google.com/view/les-logiciels-libres/pharo
> http://nosoftwarepatents.wikidot.com/smalltalk
> http://twitter.com/RenePaulMages

Reply via email to