• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How does the Swift Darwin module work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does the Swift Darwin module work?


  • Subject: Re: How does the Swift Darwin module work?
  • From: Rick Mann <email@hidden>
  • Date: Sat, 18 Oct 2014 18:29:53 -0700

> On Oct 18, 2014, at 18:22 , Roland King <email@hidden> wrote:
>
> Write a simple c wrapper around the thing you’re trying to do and that bridges across to swift. You could probably try to write something really generic which wraps fcntl() using an UnsafeMutablePtr<UInt8> as a final argument and then massaging stuff in Swift to poke it over and back, but that really would be a horror. You’re probably better off just shimming the actual operations you really actually need into a set of specialized c calls, each one should take 2-3 lines of code only for that.

That's what I ended up doing (setNonblocking(int inFileDescriptor)), but, I was asking for the sake of learning the language. It would be nice to have generic replacements for fcntl() and ioctl().

--
Rick Mann
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How does the Swift Darwin module work?
      • From: Roland King <email@hidden>
References: 
 >How does the Swift Darwin module work? (From: Rick Mann <email@hidden>)
 >Re: How does the Swift Darwin module work? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: How does the Swift Darwin module work? (From: Roland King <email@hidden>)
 >Re: How does the Swift Darwin module work? (From: Rick Mann <email@hidden>)
 >Re: How does the Swift Darwin module work? (From: Roland King <email@hidden>)

  • Prev by Date: Re: How does the Swift Darwin module work?
  • Next by Date: Re: How does the Swift Darwin module work?
  • Previous by thread: Re: How does the Swift Darwin module work?
  • Next by thread: Re: How does the Swift Darwin module work?
  • Index(es):
    • Date
    • Thread