[Squeak-fr] squeak 3.10 et CommandShell
David T. Lewis
lewis at mail.msen.com
Jeu 20 Nov 11:48:45 UTC 2008
On Thu, Nov 20, 2008 at 12:20:07AM +0100, Fr?d?ric Ferr?re wrote:
> Bonjour,
>
> je rencontre un petit probl?me avec le package CommandShell
> r?cup?r? via SqueakMap sur une image squeak3.10-web.
>
> L'?valuation de :
>
> CommandShell command: 'ls'
>
> me renvoie une erreur (voir image jointe)
>
>
> Le code de la m?thode de la classe CommandShell
> =============
> environment
>
> ^ environment ifNil:
> [environment := Smalltalk at: #OSProcess ifPresent:
> [:osp | osp thisOSProcess environment deepCopy]].
> =============
>
> Curieusement, la cle #OSProcess n'existe pas dans la collection Smalltalk
> d'ou la valeur nil renvoy?e et utilis?e dans la m?thode
> setHomeDirectory de CommandShell.
>
> Que faire ?
Bonjour Fr?d?ric,
I am sorry that I must reply in English, I hope that you do not mind.
This is a bug in CommandShell. It is fixed in CommandShell on SqueakSource,
so you can load the latest version there. I have not updated SqueakMap
though.
I recommend that you also load package OSProcess, otherwise CommandShell
is not very useful.
The correct method for CommandShell>>environment is this:
environment
^ environment ifNil:
[environment := (Smalltalk at: #OSProcess ifPresent:
[:osp | osp thisOSProcess environment deepCopy]) ifNil: [Dictionary new]].
Sorry for my poor French ;)
Dave
Plus d'informations sur la liste de diffusion Squeak-fr