Author Topic: Running an outside call?  (Read 5600 times)

Ken Arck

  • Guest
Running an outside call?
« on: January 22, 2012, 07:22:16 pm »
Is there anyway to call a binary from within Scriba (Linux)?

Support

  • Administrator
  • *****
  • Posts: 1
    • View Profile
Re: Running an outside call?
« Reply #1 on: January 22, 2012, 07:31:12 pm »
Is there anyway to call a binary from within Scriba (Linux)?

Do you mean call an external library function in a shared object? (.so)

ScriptBasic has a nice extension module API that makes extending the language rather easy. The API is composed of macros that allows wrapping an external library with very few lines of code.

The Windows version of ScriptBasic has an extension module called DYC that will let you call generic DLLs. Under Linux I use GTK-Server as my FFI interface.



Ken Arck

  • Guest
Re: Running an outside call?
« Reply #2 on: January 22, 2012, 07:39:05 pm »
I mean lets say (as an example only) that I want to call a compiled binary in /usr/local/bin from within a Scriba program and then return to the Scriba program and continue onward

Support

  • Administrator
  • *****
  • Posts: 1
    • View Profile
Re: Running an outside call?
« Reply #3 on: January 22, 2012, 07:46:38 pm »
Ken,

When you say CALL, I assume you mean calling a function in a script or an external library. If you mean execute a system or external executable, (program) then ScriptBasic supports two methods.

EXECUTE - can wait for the external program to finish.

SYSTEM - start an external program in a separate process in asynchronous mode

John

Ken Arck

  • Guest
Re: Running an outside call?
« Reply #4 on: January 22, 2012, 07:48:30 pm »
Excellent, thank you!

(I was looking though the documentation searching for the wrong keywords!)