diff options
Diffstat (limited to 'fd_move.c')
| -rw-r--r-- | fd_move.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fd_move.c b/fd_move.c new file mode 100644 index 0000000..1aa557f --- /dev/null +++ b/fd_move.c | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #include "fd.h" | ||
| 2 | |||
| 3 | int fd_move(to,from) | ||
| 4 | int to; | ||
| 5 | int from; | ||
| 6 | { | ||
| 7 | if (to == from) return 0; | ||
| 8 | if (fd_copy(to,from) == -1) return -1; | ||
| 9 | close(from); | ||
| 10 | return 0; | ||
| 11 | } | ||
