How to execute console applications on windows operating system from ruby installed on linux? -
i trying run console application (say win_a.exe; having few command line parameters) ruby script(say lin_r.rb) on linux. win_a.exe interacting windows services on windows server 2008. want run win_a.exe @ particular point via lin_r.rb (reason that, @ time; having few parameters need passed win_a.exe , result)
i searched online did not useful links. one solution in mind is:
create nfs share on windows , map linux.
linux: write parameter/command in new file(should created on nfs share) lin_r.rb
window: watchdog program(need write this) looking new file. if found execute win_a.exe parameters , write result new out file.
linux: yey! got result
is approach? think?
thanks, vipul
your approach made work, if implementing this, utilize http instead of nfs. both computers involved capable of making , receiving http requests, setup should less nfs.
the basic approach have linux based script create http request windows machine, parameters .exe specified query parameters (if utilize request). on windows side, "watchdog" programme little web service respond request linux machine, execute programme specified options, , homecoming result.
the web service on windows machine can utilize whatever technology prefer. utilize sinatra+thin, selection you.
whichever approach take, nfs based, http based, or else, should make sure give thought security. means should not blindly pass arguments receive lin_r.rb win_a.exe program. should only take specific arguments, , should create effort verify person making request (or writing file if utilize nfs) someone have authorized have access.
ruby linux windows cross-platform
No comments:
Post a Comment