Resolved Parsing /etc/hosts


i want parse /etc/hosts , manipulate adding/removing hosts. i'm using swift build osx application, before build parser /etc/hosts, want make sure there's nothing out there available don't have reinvent wheels. researches, found:

1. mdnsresponder seems parse /etc/hosts according hosts manpage, couldn't find exposed api manipulate hosts file;

2. gethostent seems able that, not sure how use standard c code on swift , link libc project.

appreciated, thanks! :)
 

use best tool job. if other languages can out of box, makes think swift best?

use can talk c more effortlessly. obj-c.
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Sean Penn, "Chapo Guzman", and Rolling Stone

Subler - What is "Fix Audio Fallbacks"?

Help please Strange logs