About scripting...

stephane ducasse stephane.ducasse at free.fr
Sun Aug 14 16:06:44 UTC 2005


>
>
> Yes, but from the limited time I spent looking into it, it not so  
> easy to execute  a program from squeak though. I got as far as  
> loading the OSProcessPlugin before talk of using VMMaker got me  
> thoroughly confused. Is there a simple guide on how to execute a  
> shell command from Squeak that does not require me to compile a VM?
>
> Daniel
>
> David T. Lewis wrote:
>
>> On Fri, Aug 12, 2005 at 10:55:01AM +0200, stephane ducasse wrote:
>>
>>> But why because this is in XXX we cannot have it in Smalltalk.
>>> I would like to be able to write
>>>
>>> Directory default filesAndFoldersDo: [:file | Output show: file   
>>> size ; cr]
>>>
>>> and not manipulate strings as in python.
>>>
>> <ot>
>>   <ot>
>>     Well, terseman is nowhere in sight, and somebody has to start
>>     somewhere, so...in a Squeak startup script, to be run headless as
>>     in "squeak -headless squeak.image file:///foo/bar/ 
>> myStartupScript",
>>     you could do this:
>>             | dirStack stdout |
>>         stdout _ FileStream fileNamed: '/dev/tty'.
>>         dirStack _ OrderedCollection with: FileDirectory default.
>>         [dirStack isEmpty] whileFalse:
>>             [ | dir |
>>             dir _ dirStack first.
>>             dirStack addAll: (dir entries
>>                 select: [:d | d isDirectory]
>>                 thenCollect: [:dd | FileDirectory on: dir  
>> pathName, dir slash, dd name]).
>>             (dir entries reject: [:d | d isDirectory])
>>                 do: [:f | stdout nextPutAll: dir pathName, dir  
>> slash, f name , ': ', f fileSize asString, String lf].
>>             dirStack removeFirst].
>>         Smalltalk snapshot: false andQuit: true
>>     I'm assuming that "Output" refers to stdout in the  
>> hypothetical example,
>>     and of course in Seaside you would be doing something else,  
>> perhaps a
>>     table of file names and file sizes I suppose. But as long as  
>> we are
>>     this far off topic, what's the difference?
>>   </ot>
>> </ot>
>> Dave
>>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>




More information about the Squeak-dev mailing list