Skip to content

Instantly share code, notes, and snippets.

@directorscut82
Created January 8, 2018 10:04
Show Gist options
  • Save directorscut82/32cb01fa37d3ee625b161dbb0d9e99cd to your computer and use it in GitHub Desktop.
Save directorscut82/32cb01fa37d3ee625b161dbb0d9e99cd to your computer and use it in GitHub Desktop.
print sha256 sums
int printsha256sums(char* fname)
{
char path[1035];
char command[256];
snprintf(command,256,"sha256sum %s",fname);
FILE *fpp = popen(command, "r");
if (fpp == NULL)
return 0;
fgets(path, sizeof(path)-1, fpp);
fprintf(stderr,"%s", path);
pclose(fpp);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment