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.
Thank you.
Regards, 
–Mr Bee
 

  Tampilkan pesan asli     Pada Selasa, 24 Januari 2017 13:45, Will 
Field-Thompson <will.a...@gmail.com> menulis:
 

 From the source and from status document (search "terminate()"), it seems like 
the answer is that terminate has not yet been implemented. 
Take this with a grain of salt since I haven't tried it out myself, but it 
might look something like the following:

import Glibc
kill(task.processIdentifier, SIGTERM)
Where task is your Task (soon to be renamed Process). This isn't exactly the 
same as terminate() which I think does some error checking but it gives you a 
start.
Good luck!
On Tue, Jan 24, 2017 at 12:16 AM Mr Bee via swift-users <swift-users@swift.org> 
wrote:

Hi,
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:
fatal error: terminate() is not yet implemented: file Foundation/NSTask.swift, 
line 407                                                        Illegal 
instruction
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?
Thank you.
Regards, 
–Mr Bee
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users



   
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to