[swift-evolution] Reading from Standard In
Austin Zheng
austinzheng at gmail.com
Sun Dec 6 23:34:58 CST 2015
Does the 'readline' function (introduced in Swift 2.x) work for your purposes? http://swiftdoc.org/v2.1/func/readLine/ <http://swiftdoc.org/v2.1/func/readLine/>
Austin
> On Dec 6, 2015, at 9:19 PM, Kyle Bashour via swift-evolution <swift-evolution at swift.org> wrote:
>
> Hi Everyone,
>
> I hope this is the best place to discuss this — if not, please point me in the right direction! It seems like an appropriate topic for evolution though.
>
> According to my limited knowledge and basic research, Swift doesn't currently have a simple way to read from standard input from the console. The best solution I found was this StackOverflow solution <http://stackoverflow.com/questions/24046952/xcode-6-swift-read-standard-input-console-to-string>, but it doesn't seem to be implemented on Linux yet, and I think it should be simpler than having to use NSFileHandle if Swift is to be used as a true systems programming language.
>
> Of course, if there is an easier way to do this, please let me know! Or a reason why the SO solution is the best way to do this. Thanks for reading, would love to hear thoughts on this. I also just joined the list, so if this has already been discussed, apologies.
>
> -- Kyle Bashour
>
> @kylebshr
> kylebashour.com <http://kylebashour.com/> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151206/8476cd0c/attachment.html>
More information about the swift-evolution
mailing list