<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 17, 2017, at 5:16 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Thu, Aug 17, 2017 at 6:46 PM, Taylor Swift <span dir="ltr" class=""><<a href="mailto:kelvin13ma@gmail.com" target="_blank" class="">kelvin13ma@gmail.com</a>></span> wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">I don’t think the “is this library functionality or standard library functionality” argument is worth having, but if <span style="font-family:monospace,monospace" class="">stdout</span> and <span style="font-family:monospace,monospace" class="">stdin</span> are first-class citizens in the Swift world, so should <span style="font-family:monospace,monospace" class="">stderr</span>.<br class=""><br class=""></div>As for bringing Foundation into the discussion, you can’t really talk about Foundation without also talking about the mountains of problems that come with the monolith pattern. But that’s a completely different conversation to be had.<br class=""></div></blockquote><div class=""><br class=""></div><div class="">I'm not sure what you're getting at here, but I don't believe you've addressed my question, which is: it's been firmly decided that I/O belongs in Foundation, and Foundation does in fact offer such facilities--what is missing from those facilities, and how can we fill it out?</div></div></div></div></div></blockquote><br class=""></div><div>Lots of I/O functionality is missing from Foundation. Foundation's design from time immemorial is that generally only relatively simple and high-level operations are available in Foundation itself, and if you want to do complicated or non-portable things then you are expected to drop down to POSIX or other C interfaces. That design works less well in Swift than it did in Objective-C because Swift's interface with C, especially low-level C, is often ugly.</div><br class=""><div class="">Simple example: there is no way to access file information directly via NSFileHandle. You need to call NSFileHandle.fileDescriptor and pass that to fstat() or fcntl(). The NSFileHandle API in general is sparse and wholly inadequate for sophisticated I/O.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">-- </div><div class="">Greg Parker <a href="mailto:gparker@apple.com" class="">gparker@apple.com</a> Runtime Wrangler</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>