LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   a simple download schedular (self made) (https://www.linuxquestions.org/questions/linux-newbie-8/a-simple-download-schedular-self-made-805122/)

aarsh 04-30-2010 04:31 AM

a simple download schedular (self made)
 
I have created a simple download schedular with source-code give below :

---------------------record_strokes.sh-------------------

touch /home/student/packs/lynx/logfile

lynx -cmd_log /home/student/packs/lynx/logfile

---------------------play_strokes.sh---------------------
lynx -cmd_script='/home/admin/packs/lynx/logfile' www.google.com


--------------------download_links.sh---------------------
wget http://iso.linuxquestions.org/downlo...i386-disc1.iso

wget http://iso.linuxquestions.org/downlo...i386-disc2.iso

wget http://iso.linuxquestions.org/downlo...i386-disc3.iso




--------------------halt.sh---------------------
halt


--------------------main.c---------------------

#include<stdio.h>
//#include<sys/ipc.h>
//#include<sys/shm.h>
//#include<sys/types.h>
//#include<sys/sem.h>
#include<pthread.h>

void download(void)
{
system("sh download_links.sh");
}
main()
{
pthread_t id1,id2;
system("sh record_strokes.sh");
system("sh play_strokes.sh");
pthread_create(&id1,NULL,download,NULL); // Error in 3rd para.
pthread_create(&id2,NULL,download,NULL); // Error in 3rd para.
pthread_exit(NULL);
system("sh halt.sh");
return 0;
}


So, this is a simple download scheduler program code. Which creates multiple threads of the downloading process - wget (i could also have used 'curl' instead 'wget').Can you debug this code?
Can anyone guide me please?

unSpawn 04-30-2010 05:52 AM

Please post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...f-made-805124/.


All times are GMT -5. The time now is 07:10 AM.