Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

fread

View gist:1281162
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
char *command1= "/usr/bin/dscl";
 
char *args1[] = {".","-read","/SharePoints/FolderName","directory_path",nil};
 
FILE *pipe = nil;
 
err = AuthorizationCreate(nil,
kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults,
&authorizationRef);
 
err = AuthorizationExecuteWithPrivileges(authorizationRef,
command,
kAuthorizationFlagDefaults,
args1,
&pipe);
 
char buffer[2048];
while (!feof(pipe)) {
size_t readBytes = fread(buffer, sizeof(buffer[0]), sizeof(buffer) / sizeof(buffer[0]), pipe);
// use buffer here
}
fclose(pipe);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.