Elijah Newren | d5fff46 | 2023-04-22 20:17:12 +0000 | [diff] [blame] | 1 | #ifndef COPY_H |
| 2 | #define COPY_H |
| 3 | |
| 4 | #define COPY_READ_ERROR (-2) |
| 5 | #define COPY_WRITE_ERROR (-3) |
| 6 | int copy_fd(int ifd, int ofd); |
| 7 | int copy_file(const char *dst, const char *src, int mode); |
| 8 | int copy_file_with_time(const char *dst, const char *src, int mode); |
| 9 | |
Johannes Schindelin | f5b2af0 | 2024-04-17 11:38:18 +0200 | [diff] [blame] | 10 | /* |
| 11 | * Compare the file mode and contents of two given files. |
| 12 | * |
| 13 | * If both files are actually symbolic links, the function returns 1 if the link |
| 14 | * targets are identical or 0 if they are not. |
| 15 | * |
| 16 | * If any of the two files cannot be accessed or in case of read failures, this |
| 17 | * function returns 0. |
| 18 | * |
| 19 | * If the file modes and contents are identical, the function returns 1, |
| 20 | * otherwise it returns 0. |
| 21 | */ |
| 22 | int do_files_match(const char *path1, const char *path2); |
| 23 | |
Elijah Newren | d5fff46 | 2023-04-22 20:17:12 +0000 | [diff] [blame] | 24 | #endif /* COPY_H */ |