[swift-users] Problem with console apps

Andrey Fidrya af at zabiyaka.com
Thu Feb 9 05:33:04 CST 2017


A follow-up:
flushing stdout works in console, but not in Xcode.
Neither setbuf(stdout, nil) nor fflush(stdout) helps, so it appears
this is an Xcode issue.

import Darwin

setbuf(stdout, nil)
while true
 {
    print("A question.")
    print("Your answer: ", terminator: "") // not printed
    //fflush(stdout)
    
    sleep(1)
    print("")
}

Regards,
Andrey


> On 8 Feb 2017, at 20:04, Andrey Fidrya <af at zabiyaka.com> wrote:
> 
> Hi All,
> 
> In Xcode 8.3 beta print() stopped outputting unterminated lines:
> https://bugs.swift.org/browse/SR-3827 <https://bugs.swift.org/browse/SR-3827>
> 
> I've retested with recently released beta 2 and the issue is still present.
> Could anyone from dev team take a look at this issue please?
> I'm worried that it will make into release because it makes working
> with interactive console apps impossible.
> 
> Regards,
> Andrey
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170209/d4ce4636/attachment.html>


More information about the swift-users mailing list