open process
Dar Scott Consulting
dsc at swcp.com
Sat Sep 28 14:25:24 EDT 2019
I'm glad that was helpful. For me, when using open process as a background shell is knowing when things are done. In my example, I can wait for non-empty read results and then wait for a few empty read results. There is probably a better way.
> On Sep 28, 2019, at 11:57 AM, JB via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> It works for me too, Thanks
>
> Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
> lo0 16384 <Link#1> 82239 0 82239 0 0
> lo0 16384 localhost ::1 82239 - 82239 - -
> lo0 16384 127 localhost 82239 - 82239 - -
> lo0 16384 localhost fe80:1::1 82239 - 82239 - -
> gif0* 1280 <Link#2> 0 0 0 0 0
> stf0* 1280 <Link#3> 0 0 0 0 0
> en0 1500 <Link#4> 34:15:9e:26:fa:60 1633080 0 1207358 0 0
> en0 1500 jb.local fe80:4::3615:9eff 1633080 - 1207358 - -
> en0 1500 192.168.0 192.168.0.2 1633080 - 1207358 - -
> en1 1500 <Link#5> 7c:6d:62:a4:64:ab 0 0 0 0 0
> fw0 4078 <Link#6> 34:15:9e:ff:fe:26:fa:60 0 0 0 0 0
>
>
> JB
>
>> On Sep 28, 2019, at 10:24 AM, Dar Scott Consulting via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> This works for me, LC 9.5 Mac.
>>
>> on mouseup
>> set the cursor to watch
>> put "netstat -i" into p
>> put p -- flash
>> open process p for read
>> wait 1 seconds with messages
>> read from process p until empty
>> close process p
>> put it
>> end mouseup
>>
>>
>>> On Sep 28, 2019, at 8:05 AM, JB via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>
>>> In a shell command I can execute a external program
>>> using the following code:
>>>
>>> on mouseUp
>>> set the defaultFolder to desktop
>>> put “myPic.jpg" into tFILE1
>>> put “myPic copy.jpg" into tFILE2
>>> put shell( "./copy" && quote & tFILE1 & quote && quote & tFILE2 & quote) into pData
>>> answer question pData —will be success or failed
>>> end mouseUp
>>>
>>> The code above will execute a program that has two arguments which are
>>> the source file and destination file. It is a simple copy program.
>>>
>>> I was reading about open process:
>>> --open process appName [for [text|binary] {read | write | update | neither}]
>>>
>>> I can open a process and execute the above mentioned external program
>>> but I am not able to supply the arguments.
>>>
>>> Is it possible using open process to execute a program with arguments
>>> and if it is would it be better to use the shell command or open process?
>>>
>>> I know if you use a shell command it takes control until it is done and
>>> open process might run in the background which I do not really need
>>> that I know of in this instance.
>>>
>>> JB
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list