STYLE: Nightly Version update
[cmake.git] / Tests / ComplexOneConfig / Library / create_file.cxx
blobd41551980a311f03746b691a249380ba63f329ee
1 #include <stdio.h>
2 #include <stdlib.h>
4 int main (int argc, char *argv[])
6 if (argc < 2)
8 fprintf(stderr, "Missing name of file to create.\n");
9 return EXIT_FAILURE;
12 FILE *stream = fopen(argv[1], "w");
13 if(stream == NULL)
15 fprintf(stderr, "Unable to open %s for writing!\n", argv[1]);
16 return EXIT_FAILURE;
19 if(fclose(stream))
21 fprintf(stderr, "Unable to close %s!\n", argv[1]);
22 return EXIT_FAILURE;
25 fprintf(stdout, ">> Creating %s!\n", argv[1]);
27 return EXIT_SUCCESS;