LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 04-30-2010, 04:31 AM   #1
aarsh
Member
 
Registered: Mar 2010
Location: ATL, GA
Distribution: openSUSE 11.2 , salckware ,ubuntu
Posts: 169

Rep: Reputation: 18
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?
 
Old 04-30-2010, 05:52 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
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/.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a simple download schedular aarsh Linux - Software 1 04-30-2010 05:49 AM
LXer: Symfony Made Simple LXer Syndicated Linux News 0 07-11-2007 05:48 PM
home made simple string class tooparam Programming 1 05-17-2007 08:07 AM
Boot Loader -made simple ? pacer Red Hat 4 11-08-2004 12:37 PM
Can Samba and Windows be made simple? brundles Linux - Networking 2 12-28-2003 09:24 PM


All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration