diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-03-03 19:53:17 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-03-03 20:23:51 +0200 |
| commit | 19a30a3f6e15da184fc449315314af666f2082bf (patch) | |
| tree | c9263fef3e6fea67f07405057777057684f9b6a0 /src/fileops.h | |
| parent | 6b02b215169d493abe35d8036c3cf687521e08a5 (diff) | |
| download | libgit2-19a30a3f6e15da184fc449315314af666f2082bf.tar.gz | |
Add new move function, `gitfo_mv_force`
Forces a move by creating the folder for the destination file, if it
doesn't exist.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/fileops.h')
| -rw-r--r-- | src/fileops.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fileops.h b/src/fileops.h index 16e71038b..fd150df5e 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -68,7 +68,13 @@ extern git_off_t gitfo_size(git_file fd); extern int gitfo_read_file(gitfo_buf *obj, const char *path); extern void gitfo_free_buf(gitfo_buf *obj); -extern int gitfo_move_file(char *from, char *to); + +/* Move (rename) a file; this operation is atomic */ +extern int gitfo_mv(const char *from, const char *to); + +/* Move a file (forced); this will create the destination + * path if it doesn't exist */ +extern int gitfo_mv_force(const char *from, const char *to); #define gitfo_stat(p,b) stat(p, b) #define gitfo_fstat(f,b) fstat(f, b) |
