Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cmb69
Created September 20, 2019 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cmb69/40c8c3f40795d9032aec49d13e452fa5 to your computer and use it in GitHub Desktop.
Save cmb69/40c8c3f40795d9032aec49d13e452fa5 to your computer and use it in GitHub Desktop.
Write email to disk
#include <Windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
FILE *out;
char c;
if (argc != 2) {
return 1;
}
if (!(out = fopen(argv[1], "w"))) {
return 1;
}
while ((c = getchar()) != EOF) {
putc(c, out);
}
fclose(out);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment