I am using librsync library for maintaining file versions. I am not able to open files from a network.
Example (creating signature file):
int main(int argc, char** argv)//FILE *original, FILE *signature)
{
if(argc != 2)
{
cout<<"Enter the original file name."<<endl;
exit(1);
}
FILE *fpa;
fpa = fopen(argv[1],"r");
if(fpa==NULL)
{
cout<<"ERROR"<<endl;
exit(1);
}
FILE *fps;
fps = fopen("sig.sig","w+");
rs_result res = rs_sig_file(fpa, fps, 1,2,NULL);
fclose(fpa);
fclose(fps);
printf("Result code: %d\n", res);
return 0;
}
When I run the program with argument of a file over a network, e.g.
./a.out cs1130218@palasi.cse.iitd.ernet.in:games.txt
fpa is NULL.
I guess that fopen is not made for opening files over a network. I need a command which can do this. Any command in c/c++. You can clearly see what I want to do with the programme.