practice.c
#include <stdio.h>
#include <stdlib.h>
char *transfer(char *f1, char *f2){
char cmd[500];
sprintf(cmd, "rsync -av %s %s", f1, f2);
system(cmd);
}
int main(void){
transfer("/home/bilal/Pictures/New", "/home/bilal/Music");
return 0;
}
practice.py
from ctypes import cdll
transfer = cdll.LoadLibrary("/Path/to/practice.so")
transfer.transfer("/home/bilal/Pictures/New", "/home/bilal/Music")
Error
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.