diff options
Diffstat (limited to 'meson/test cases/native/3 pipeline/depends/filecopier.c')
-rw-r--r-- | meson/test cases/native/3 pipeline/depends/filecopier.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meson/test cases/native/3 pipeline/depends/filecopier.c b/meson/test cases/native/3 pipeline/depends/filecopier.c new file mode 100644 index 000000000..e10e4e773 --- /dev/null +++ b/meson/test cases/native/3 pipeline/depends/filecopier.c @@ -0,0 +1,23 @@ +#include<stdio.h> +#include<assert.h> + +#define BUFSIZE 1024 + +int main(int argc, char **argv) { + char buffer[BUFSIZE]; + size_t num_read; + size_t num_written; + FILE *fin = fopen(argv[1], "rb"); + FILE *fout; + assert(argc>0); + assert(fin); + num_read = fread(buffer, 1, BUFSIZE, fin); + assert(num_read > 0); + fclose(fin); + fout = fopen(argv[2], "wb"); + assert(fout); + num_written = fwrite(buffer, 1, num_read, fout); + assert(num_written == num_read); + fclose(fout); + return 0; +} |