Open Systemfile under MacOS X

BlitzMax Forums/BlitzMax Programming/Open Systemfile under MacOS X

Ho can i open a Systemfile under MacOS X. I need the root permission. Can someone help me?

as example:

file=OpenFile("/etc/pure-ftpd/pure-ftpd.plist")

If Not file RuntimeError "could not open file openfile.bmx"

While Not Eof(file)
Print ReadLine(file)
Wend
CloseStream file

Start the app as root.

Can i do it without starting as root?

Probably not, thats probably one of the core security restrictions in OSX.

Shouldn't it be possible to fire the authentication dialog from an application? Finder , for example, also asks for the su-password before it performs certain operations.

thats a different approach but not with BM
you would need to rewrite or modify some core parts to do it via sudo calls

Thanks, Dreamora. Then launching the app via sudo remains the only valid option.