Skip to content

Commit

Permalink
make rename.c test first create file to rename
Browse files Browse the repository at this point in the history
  • Loading branch information
droundy committed Jun 28, 2016
1 parent 8ef1733 commit 0905ee7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/rename.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include <stdio.h>

int main(void) {
FILE *f = fopen("tmp/foodle", "a");
fprintf(f, "hi there!\n");
fclose(f);
fprintf(stderr, "about to rename\n");
int returncode = rename("tmp/foo", "tmp/barbaz");
int returncode = rename("tmp/foodle", "tmp/barbaz");
fprintf(stderr, "rename gives %d\n", returncode);
return 0;
}

0 comments on commit 0905ee7

Please sign in to comment.