First of all, using system();
is a C method and is not very reliable at all for executing commands like that, (I know from experience).
What you would want to do, is copy the NSTask.h file from the foundation.framework into your project window and use it. the way to find it is by opening a new project for the mac and clicking show in finder on the foundation.framework and then copy it. (Make sure to remove the lines near the top that check if you have Mac OS 10.6 or greater)
Then try running it. If it still doesn't have the right privileges, try looking into setuid();
but other than that, i don't know how it's done.
Maybe you can contact the developer of iFile, he would know how...