Re: [swift-users] Start another program from Swift script

2018-01-04 Thread Michael Ilseman via swift-users
The “Shell Out” package’s source code shows some simple usage of Foundation’s Process: https://github.com/JohnSundell/ShellOut/blob/master/Sources/ShellOut.swift#L33. That package also handles stdout / stdin, but for more sophisticated uses of FileManager the “Files” package’s source has some

Re: [swift-users] Start another program from Swift script

2018-01-04 Thread Karl Wagner via swift-users
These kinds of things live in Foundation, not the standard library: import Foundation let p = Process() p.executableURL = URL(fileURLWithPath: "/bin/ps") try p.run() The Process class provides you with stdin/out/error handles for the process

[swift-users] Start another program from Swift script

2018-01-04 Thread Седых Александр via swift-users
Well, for example in Python we can run another program from interpreter by   import subprocess result = subprocess.run('ruby script.rb').stdout   My question is next: Can we do something from Swift file at runtime or maybe from terminal via REPL   And can you send me resource when I can read