I need help to combine a c-program using curl(to retrieve txt files from internet) and another c-program using popen. currently the popen is using the command ls -l (to list the current folder in terminal).
I have 2 files, the first one is curl program,
which have to retrieve 2 text files from the internet and process them later(I haven't make the manipulation process in the code).
size_t write_data( void ptr, size_t size, size_t nmeb, void stream)
FILE file = fopen(DESTINATION_FILE,"w+");
FILE file2 = fopen(DESTINATION_FILE2,"w+");
CURL *handle = curl_easy_init();
and the other is popen program,
which currently is listing the contents in the folder through terminal.
fp = popen("ls -l", "r");
while ( fgets( line, sizeof line, fp))
Now the thing is, I need to combine these 2 programs, so that only using 1 program files, I can retrieve txt files using curl as the command in popen, and can manipulate the retrieved txt files later on.
When I run the 2 program separately, it has no errors. but when I tried to combine and compile the code, it has some errors.
Here's my try: