Well, I have some code like:
FILE *file;
AuthorizationRef authorizationRef;
OSStatus status;
...
status = AuthorizationExecuteWithPrivileges(authorizationRef, "/sbin/mount_hfs", kAuthorizationFlagDefaults, args, &file);
...
also I am getting expected error “mount_hfs: Invalid argument” while executing.
Is there easy way to track this error?
like:
return NO; //if error is "mount_hfs: Invalid argument"
and
return YES; //if no errors
I have tried this
if( file != NULL )
{
while( fgets(buffer,255,file) != NULL )
{
printf("%s",buffer);
}
pclose(file);
}
file isn’t null but no print 😐
Google for SMJobless. That’s what your supposed to use, but I haven’t figured how to use arguments for commands in that model.