Global package cache & stdin, stdout, stderr on Pharo

Written on May 18 2012.

This blog post was written a long time ago and may not reflect my current opinion or might be technically out of date. Read with a grain of salt.

When loading a package with Monticello, a copy is cached in the directory ‘package-cache’ in your image folder. This is super useful when you need a package that you already have downloaded. Unfortunately, this cache is limited to the image directory. If you need that package in another image which is in another directory, you’ll have to redownload the package.

Here’s a little trick to have a global package cache:

MCCacheRepository default directory:
  (FileDirectory on: '/home/fstephany/package-cache/')

Of course, adapt the path to your configuration. Thanks Mariano for the tips (original discussion).

Another super useful things is the ability to send stuff to `sdtin`, `stdout` and `stderr`. I don’t know if it was present prior Pharo 1.3 but I’ve just discovered how to play with the standard streams:

FileStream stdout nextPutAll: 'Yopla'

Browse the class side of FileStream for more ;)