<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1485240374574_2815" dir="ltr"><span id="yui_3_16_0_ym19_1_1485240374574_2947">I see. Thank you for the information and the trick. Yes, it works. Although I'm not sure killing a process is similar to terminating it, I think I can live with it. At least while it's not yet implemented. I mostly use it to terminate a long stucked processes anyway.</span></div><div id="yui_3_16_0_ym19_1_1485240374574_2815" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym19_1_1485240374574_2815" dir="ltr"><span>Thank you.</span></div><div id="yui_3_16_0_ym19_1_1485240374574_2815" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym19_1_1485240374574_2815" dir="ltr"><span>Regards,</span></div><div></div><div id="yui_3_16_0_ym19_1_1485240374574_2814">&nbsp;</div><div class="signature" id="yui_3_16_0_ym19_1_1485240374574_2725"><div id="yui_3_16_0_ym19_1_1485240374574_2822"><br></div>–Mr Bee<div id="yui_3_16_0_ym19_1_1485240374574_2724"><br></div></div> <div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1485240374574_2813"><br><br></div><div class="thread-quoted-text unselectable custom-quoted-text" title="Tampilkan pesan asli" role="presentation" id="yui_3_16_0_ym19_1_1485240374574_3140"> <span class="icon icon-chevron-right qtd-expansion-icon" role="presentation"></span> <span class="qtd-expansion-text" tabindex="0" role="button" aria-label="Tampilkan pesan asli">Tampilkan pesan asli</span> </div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1485240374574_2812" style="display: block;"> <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1485240374574_2811"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1485240374574_2810"> <div dir="ltr" id="yui_3_16_0_ym19_1_1485240374574_2809"><font size="2" face="Arial" id="yui_3_16_0_ym19_1_1485240374574_2808"> Pada Selasa, 24 Januari 2017 13:45, Will Field-Thompson &lt;will.a.ft@gmail.com&gt; menulis:<br></font></div>  <br><br> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1485240374574_2819"><div id="yiv6842296128"><div id="yui_3_16_0_ym19_1_1485240374574_2818"><div dir="ltr" id="yui_3_16_0_ym19_1_1485240374574_2817"><div id="yui_3_16_0_ym19_1_1485240374574_2820">From the <a rel="nofollow" shape="rect" target="_blank" href="https://github.com/apple/swift-corelibs-foundation/blob/swift-3.1-branch/Foundation/Process.swift#L422">source</a>&nbsp;and from <a rel="nofollow" shape="rect" target="_blank" href="https://github.com/apple/swift-corelibs-foundation/blob/swift-3.1-branch/Docs/Status.md#entities">status document</a>&nbsp;(search "terminate()"), it seems like the answer is that terminate has not yet been implemented. </div><div id="yui_3_16_0_ym19_1_1485240374574_2821"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1485240374574_2816">Take this with a grain of salt since I haven't tried it out myself, but it might look something like the following:<br clear="none"><font face="monospace" id="yui_3_16_0_ym19_1_1485240374574_3113"><br clear="none">import Glibc</font></div><div><font face="monospace"><br clear="none"></font></div><div><font face="monospace">kill(task.processIdentifier, SIGTERM)</font></div><div><br clear="none">Where <font face="monospace">task </font>is your <font face="monospace">Task</font> (soon to be renamed <font face="monospace">Process</font>). This isn't exactly the same as <font face="monospace">terminate()</font>&nbsp;which I think does some error checking but it gives you a start.</div><div><br clear="none"></div><div>Good luck!</div><br clear="none"><div class="yiv6842296128gmail_quote" id="yui_3_16_0_ym19_1_1485240374574_2877"><div class="yiv6842296128yqt5332674795" id="yiv6842296128yqt64972"><div dir="ltr">On Tue, Jan 24, 2017 at 12:16 AM Mr Bee via swift-users &lt;<a rel="nofollow" shape="rect" ymailto="mailto:swift-users@swift.org" target="_blank" href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br clear="none"></div><blockquote class="yiv6842296128gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" id="yui_3_16_0_ym19_1_1485240374574_2876"><div class="yiv6842296128gmail_msg" id="yui_3_16_0_ym19_1_1485240374574_2875"><div class="yiv6842296128gmail_msg" style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_ym19_1_1485240374574_2874"><div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2844"><span class="yiv6842296128gmail_msg">Hi,</span></div><div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2845"><span class="yiv6842296128gmail_msg"><br clear="none" class="yiv6842296128gmail_msg"></span></div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846">I can't use terminate() function of (NS)Task on Linux because it's not yet implemented. I'm using Swift v.3.0.0 on 64-bit Ubuntu 14.04 LTS. Here's the error message upon calling the function:</div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846"><br clear="none" class="yiv6842296128gmail_msg"></div><div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_4844" style="white-space:nowrap;margin:0px;padding:0px;line-height:14px;color:rgb(255,255,255);font-family:'PT Mono', monospace;font-size:12px;background-color:rgb(31,27,27);">fatal&nbsp;error:&nbsp;terminate()&nbsp;is&nbsp;not&nbsp;yet&nbsp;implemented:&nbsp;file&nbsp;Foundation/NSTask.swift,&nbsp;line&nbsp;407&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_4845" style="white-space:nowrap;margin:0px;padding:0px;line-height:14px;color:rgb(255,255,255);font-family:'PT Mono', monospace;font-size:12px;background-color:rgb(31,27,27);">Illegal&nbsp;instruction</div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846"><br clear="none" class="yiv6842296128gmail_msg"></div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846">So, is there a way to terminate a process that is launched by (NS)Task on Linux? Or has it already implemented on Swift 3.0.2?</div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846"><br clear="none" class="yiv6842296128gmail_msg"></div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846">Thank you.</div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846"><br clear="none" class="yiv6842296128gmail_msg"></div><div class="yiv6842296128gmail_msg" dir="ltr" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846">Regards,</div><div class="yiv6842296128gmail_msg"></div><div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2847">&nbsp;</div><div class="yiv6842296128m_6142618255096255505signature yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2640"><div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2639"><br clear="none" class="yiv6842296128gmail_msg"></div>–Mr Bee<div class="yiv6842296128gmail_msg" id="yiv6842296128m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2848"><br clear="none" class="yiv6842296128gmail_msg"></div></div></div></div>_______________________________________________<br clear="none" class="yiv6842296128gmail_msg">
swift-users mailing list<br clear="none" class="yiv6842296128gmail_msg">
<a rel="nofollow" shape="rect" class="yiv6842296128gmail_msg" ymailto="mailto:swift-users@swift.org" target="_blank" href="mailto:swift-users@swift.org">swift-users@swift.org</a><br clear="none" class="yiv6842296128gmail_msg">
<a rel="nofollow" shape="rect" class="yiv6842296128gmail_msg" target="_blank" href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br clear="none" class="yiv6842296128gmail_msg">
</blockquote></div></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>