return res;
}
-int cat_file(char *src, char *dst)
-{
- int res;
- int sfd;
- int dfd;
-
- if (!src || !dst) {
- _E("Invalid argument\n");
- return -1;
- }
- sfd = open(src, O_RDONLY);
- if (sfd < 0) {
- _SE("Failed to open (%s)\n", src);
- return -1;
- }
- dfd = open(dst, O_WRONLY|O_APPEND);
- if (dfd < 0) {
- close(sfd);
- _SE("Failed to open (%s)\n", dst);
- return -1;
- }
-
- res = copy_bytes(dfd, sfd);
-
- close(sfd);
- close(dfd);
- return res;
-}
-
int move_file(char *src, char *dst)
{
if (copy_file(src, dst) < 0)
int copy_file(char *src, char *dst);
-int cat_file(char *src, char *dst);
-
int move_file(char *src, char *dst);
int dump_file_write_fd(char *src, int dfd);