<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Since this isn’t going to be coming to Foundation any time…ever, I’d take a look at the SwiftShell framework. It makes running command line utilities from swift pretty easy. Chaining outputs from previous commands into subsequent commands is also rather simple. It’s based on Process but gives a lot of sugar that may be useful for you. I’ve been using it in one of my projects on an Ubuntu machine and it is easy to work with.<div class=""><br class=""></div><div class=""><a href="https://github.com/kareman/SwiftShell" class="">https://github.com/kareman/SwiftShell</a>&nbsp;<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 30, 2017, at 1:43 AM, Nick Keets via swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">In that case I think the discussion is kind of moot, scripts are fundamentally different than apps, being terse is important and almost always you want to block.</div><div class=""><br class=""></div><div class="">If better scripting support is a non-goal for Foundation then `Process` is mostly fine as it is. My only wish would be to somehow make it easier to read and write `Data` to stdin/stdout/stderr.</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Nov 28, 2017 at 11:30 PM, Tony Parker <span dir="ltr" class="">&lt;<a href="mailto:anthony.parker@apple.com" target="_blank" class="">anthony.parker@apple.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class="">Of course, Foundation API has no way of distinguishing if the caller is considered a script or not.<div class=""><br class=""></div><div class="">If the API is a bad idea for other kinds of apps then we simply wouldn’t add it. So, I think this proposed convenience API needs to consider all of the varied clients of Foundation.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span><div class=""><span class="HOEnZb"><font color="#888888" class="">- Tony</font></span><div class=""><div class="h5"><br class=""><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Nov 28, 2017, at 12:24 PM, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com" target="_blank" class="">brent@architechies.com</a>&gt; wrote:</div><br class="m_-3332190188863513248Apple-interchange-newline"><div class=""><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><blockquote type="cite" class=""><div class="">On Nov 28, 2017, at 8:00 AM, Tony Parker &lt;<a href="mailto:anthony.parker@apple.com" target="_blank" class="">anthony.parker@apple.com</a>&gt; wrote:</div><br class="m_-3332190188863513248Apple-interchange-newline"><div class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Why does it imply a run loop rather than one of many multithreading possibilities (dispatch queue, starting one more thread, etc)? And even if it did use run loops, why is that a problem?</span></div></blockquote></div><div class=""><br class=""></div><div class="">The problem is simply that we're discussing using this feature in Swift *scripts*. Swift scripts don't typically invoke `RunLoop.run()` or `dispatch_main()`, and without changing the way they generate main() functions to intrinsically do so (and then schedule main.swift's body on the main runloop/queue), I don't see a good way for it to do so. So an async API would be inconvenient to use from a Swift script.</div><br class=""><div class="">
<span class="m_-3332190188863513248Apple-style-span" style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px"><div class=""><div style="font-size:12px" class="">--&nbsp;</div><div style="font-size:12px" class="">Brent Royal-Gordon</div><div style="font-size:12px" class="">Architechies</div></div></span>

</div>
<br class=""></div></div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></blockquote></div><br class=""></div></body></html>