Created
December 20, 2019 14:38
-
-
Save hydai/c8b0fabaa2d9bdc711cf6ba81ba46a33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define BUF_LEN 1024*16 | |
int main(int argc, char* argv[]) { | |
FILE *pFile=NULL; | |
char* buf=NULL; | |
char name[128]; | |
buf = malloc(BUF_LEN); | |
memset(buf, 'a', BUF_LEN); | |
buf[BUF_LEN-1]=0; | |
for (int i = 0; i < 2147483647; i++) { | |
sprintf(name, "./garbage%i", i); | |
pFile = fopen(name, "w+"); | |
printf("pFile = %p\n", pFile); | |
for (int j = 0; j < 512; j++) { | |
fprintf(pFile, "%s", buf); | |
} | |
fclose(pFile); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment