Skip to content
Advertisement

Process (NSTask) fileHandleForReading readabilityHandler closure not being called on Linux

When compiling the following code in macOS it runs and gives output.

JavaScript

output:

JavaScript

But when I compile and run this in a Ubuntu Swift docker image (Swift version 5.0.1), the readabilityHandler closure doesn’t get called at all.

Advertisement

Answer

This appears to be fixed in the swift:latest Docker image (5.1.4 at the time of writing). It looks like readabilityHandler was implemented in Linux and merged in the run-up to Swift 5.1.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement