1 Reply Latest reply on Sep 2, 2010 2:10 AM by Neobox75

    File API and Mac OS X


      I'm a web developer and I've recently switched from Windows to Mac OS X Snow Leppard. While on Windows, I developed an AIR 1.5 app that allowed me to open my hosts file and add/edit/remove hosts using a form then saving the updated hosts file. Before I moved to Mac, I wasn't concerned about file permissions because the app was only for my personal use on a Windows machine with one user account. Now that I'm on Mac, I can't save the edited hosts file because of permissions issues on the host file.


      can i create a popup that prompts for the username and password and passes it to the OS somehow to save the host file which is stored in
      /private/etc/hosts? I realize this could be a security risk if not done carefully, but the task is very specific; WRITE the changes to disc and CLOSE the file. Surely the AIR File API has a way to do this on Mac (and Linux in general since that is where Mac is based). Right now, I use sudo and vi to make hosts manually but that is clunky and a form is much easier.