LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Closed Thread
  Search this Thread
Old 04-30-2010, 04:32 AM   #1
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

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:53 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

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


Closed Thread



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 (self made) aarsh Linux - Newbie 1 04-30-2010 05:52 AM
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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:03 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
Open Source Consulting | Domain Registration