Click here to Skip to main content
15,936,758 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

#include <stdio.h>
#include <stdlib.h>

char *transfer(char *f1, char *f2){
    char cmd[500];
    sprintf(cmd, "rsync -av %s %s", f1, f2);

int main(void){
    transfer("/home/bilal/Pictures/New", "/home/bilal/Music");
    return 0;

from ctypes import cdll

transfer = cdll.LoadLibrary("/Path/to/")
transfer.transfer("/home/bilal/Pictures/New", "/home/bilal/Music")

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
sent 26,209,993 bytes  received 92,218 bytes  3,506,961.47 bytes/sec
total size is 140,764,280,507,967  speedup is 5,351,804.09

What I have tried:

In this code, I am trying to copy the data from the first path to the second path and I am using ctypes to call the C file in python but when I run the Python code, it gives me so many lines of error. I don't know what is the problem with it and I am just pasting some lines of error. I hope you will understand.
Updated 28-Jan-21 6:39am

1 solution

The error is caused by a problem within the rsync program:
23 Partial transfer due to error.

See rsync(1) - Linux man page[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900