Skip to content

Instantly share code, notes, and snippets.

/io.c

Created December 19, 2012 08:25
Show Gist options
  • Save anonymous/4335275 to your computer and use it in GitHub Desktop.
Save anonymous/4335275 to your computer and use it in GitHub Desktop.
#include "stdio.h"
int main(int argc, char const *argv[])
{
FILE *f;
char buffer[4096];
f = fopen("bits.txt", "w");
while(1) {
fwrite(buffer, 4096, 1, f);
}
return 0;
}
import signal
import sys
def on_interrupt(signal_num, stack_frame):
f.close()
sys.exit(0)
f = open("bits2.txt", "wb")
signal.signal(signal.SIGINT, on_interrupt)
ch = bytearray(4096)
while True:
f.write(ch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment