Featured post
java - Is there any remotely cross platform way to execute an external process? -
i looking advice on how execute process cross platform.
i have written java , ruby implementations of app, less of language specific problem , more of platform specific issue.
e.g on ubuntu /usr/bin/ searched do
# ruby `handbrakecli #{args}` # works on ubuntu , other linux distros since handbrakecli in /usr/bin/
for windows search current directory running in. however, if copy windows executable current directory runtime linking error cause crash (dll not present)
the default install path handbrakecli in "program files(x86)/handbrake" (x86 in 64 bit obviously), program files isn't in search path far can tell.
for macosx have no clue how execute mac "application folders" command line other "open" command. less of issue since after handbrakecli normal executable. handbrakecli not installed /usr/bin or /usr/local/bin ( or variation there of )
my best idea make config file has path handbrakecli. if go route ideal able detect platform on, problem together. 1 have done c #ifdef sections , not in ruby or java.
i appreciate , input.
you can current os in java using
system.getproperty("os.name")
in ruby:
require 'rbconfig' puts config::config['host_os']
hope helps :)
- Get link
- X
- Other Apps
Comments
Post a Comment