kannst es so machen, keine ahnung ob das sauberer code ist:
Code:
FILE *output;
char command_line[2048];
sprintf(command_line, "echo -E '%s' | smbclient -M \"%s\" ", msg,name);
output = popen(command_line, "r");
if (!output) {
fprintf(stderr, "Error: Cannot send message\n");
return 0;
}
i = fread(command_line, 1, sizeof(command_line), output);
pclose(output);
command_line[i] = 0;
/* -- sommaire investigation of the output -- */
if (strstr(command_line, "sh: line 1: smbclient:")) {
printf("\n`smbclient' command cannot be run;\nnot installed?\n");
gruss pulp
Lesezeichen