[Newbies] ProxyPipeLine terminates external command prematurely
aldeveron at graffiti.net
Mon Sep 15 17:47:33 UTC 2014
> Sent: Monday, September 15, 2014 at 6:53 AM
> From: "David T. Lewis" <lewis at mail.msen.com>
> To: "A friendly place to get answers to even the most basic questions about Squeak." <beginners at lists.squeakfoundation.org>
> Subject: Re: [Newbies] ProxyPipeLine terminates external command prematurely
> Hi JohnReed,
> I am away and cannot be of much help right now, but I'm afraid that I may
> have given you bad advice in my last response. CommandShell does all the
> command parsing in Smalltalk, and it may not be smart enough to handle the
> complex parameters in the example you gave here. So it may be necessary to
> let the real Unix shell do the parsing, which is exactly what you were
> originally were trying to do - sorry.
> I'll try to give you a better answer in a day or so.
> Note, I have a hard time reading your examples in my mail system, so if
> you are able to post messages in plain text rather than html that would
> help me to understand what you are trying to do.
--snip html ugliness
Dave, thank you for replying. Sorry for the HTML junk. I thought it was turned off and it should be now. I think I am asking the framework to do more than it was designed to do. OSProcess and CommandShell seem to eat #&, and ProxyPipeLine seems to terminate prematurely. I have begun work on a package(is that the right word?) to create a shell command file in Squeak that I can save to the local file system and then execute that shell command file using OSProcess. My UNIX skills are a bit rusty, but have done some prototyping and think it will work. It will be fragile, and OS and application specific, but it will work for me.
If I had a clue of how to start, I would try to create a new method for OSProcess, #justDoThisAndNothingMore.
(all this work because my iPod Touch will not play aac files in flash wrappers :-(
-- original message
I have been trying to get Squeak to execute a complex command for me. I tried OSProcess and CommandShell , but OSProcess does not work and gives me no errors (that I can see), CommandShell does not work because it interprets the command line I give it as multiple commands because my command string contains #& which appears to be a special character in #findTokens:keep.
When I tried ProxyPipeLine it looks likes it starts to work because a zero length file (zlf) is written to the target directory, but that is all I get. If I run the same command line that I feed to ProxyPipeLine to an external Treminal session, the zero length file is written to the target directory and then the program runs for several seconds and the file is populated. This makes me think there is a timming issue somewhere.
My test process is:
1 In a Workspace, enter the command string and Inspect it.
2. In the Inspector, Explore self value.
3. The zlf gets written to the directory
4. The ProxyPipeline says "a PipeableOSProcess on an ExternalUnixOSProcess with pid 53180 on /opt/local/bin/rtmpdump (complete, normal termination with status 1)"
5. The zlf stays zero
6. Tried again from 1. with waitForAllToComplete, but 'pipeline did not complete evaluation'
This is the closest I have gotten to getting the results I am looking for. I think I need some way to tell the pipeline to stay alive while the pipe completes its business.
--- my invocation (this is an abbreviated version of the whole command that I am using for testing))
ProxyPipeline fromString: '/opt/local/bin/rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410651181&fmta-token=bcc4153708137784417c3b5350dd4636d4abe4884d85f3d650ff08d14357bb65" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410651181&fmta-token=bcc4153708137784417c3b5350dd4636d4abe4884d85f3d650ff08d14357bb65" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4" -o /Volumes/MediaVault/BBC/79151303.flv ' shell: CommandShell new
NOTE: This is a time sensitive command and this example is not repeatable after a few days.
Thanks in advance for any suggetions,
More information about the Beginners