Click HereClick Here
home features news forums classifieds faqs links search
5221 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Channel: #Amigaworld
Channel Policy and Guidelines

(Uses JAVA Applet and Port 1024)
Visit the Chatroom Website

Who's Online
 51 guest(s) on-line.
 2 member(s) on-line.


 Barret,  Ivan

You are an anonymous user.
Register Now!
 Ivan:  57 secs ago
 Barret:  3 mins ago
 billt:  52 mins ago
 ggw:  53 mins ago
 CodeSmith:  1 hr 15 mins ago
 freak:  1 hr 17 mins ago
 Barana:  1 hr 28 mins ago
 kvasir:  1 hr 33 mins ago
 djrikki:  1 hr 47 mins ago
 Fairdinkem:  1 hr 51 mins ago

/  Forum Index
   /  Amiga OS4 Software
      /  What's with all these program needing WGet?
Register To Post

Goto page ( 1 | 2 | 3 Next Page )
PosterThread
Hypex 
What's with all these program needing WGet?
Posted on 18-Feb-2012 3:07:39
#1 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

I'm seeing a number of programs that use WGet. And I wonder why they are programmed to need an external CLI command just to load some data off the Internet?

Executable binaries shouldn't be requiring a 3rd party tool for this kind of thing. Libraries should be used for this. For instance OS4 has the Roadshow API and also a BSDSocket API like with other Amiga Internet stacks. THat would be the proper way to do it.

Okay so that would require some learning. But if it is only a simple TCP transaction then the next best thing is a DOS handler. OS4 provides a TCP: device just like Miami did. Why isn't this being used more often?

The worse way about it is to use a command on disk and I amn seeing this a lot. Okay I have WGet installed but I don't want running commodities and applications loading in a command everytime they check the internet! Without a word mince this is just sloppy progrmmaming. I like bolognese, just not on my computer.

So, after all that, why aren't OS4 programs using the TCP: device? It's not too hard. Do it!

 Status: Offline
Profile     Report this post  
Fairdinkem 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 3:12:14
#2 ]
Regular Member
Joined: 23-Feb-2010
Posts: 412
From: Victoria, Australia

@Hypex

Feel better now LOL.

_________________
Pegasos 2 G4 - AmigaOS 4.1.6 / MorphOS 3.4

 Status: Offline
Profile     Report this post  
QuikSanz 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 4:25:22
#3 ]
Cult Member
Joined: 28-Mar-2003
Posts: 694
From: Surf City - Huntington Beach, Ca.

@Hypex,

Can it be "pointed" to an AREXX script that does all that for you?

Chris

 Status: Offline
Profile     Report this post  
TheAMIgaOne 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 4:53:46
#4 ]
Cult Member
Joined: 10-Jan-2004
Posts: 635
From: United Kingdom

@Hypex

Ive not really used TCP: and only a bit of WGET, but i'm guessing your mainly talking about programs made in hollywood, I dont see the problem. Wget is widely used on linux in scripts and hollywood is in a way a scripting type language. Wget does offer things like recursive scanning, hyperlink translations and loadsa other bits.

I'm mainly a Curl user, thou just so happens there is a library version for OS4 which helps but then again I am a C programmer.

And dont forget, wget is platform wide, with loadsa manuals and explanations on how to use it, the learning curve would I guess be simpler. So unless it causes problems in system functionality i dont see why high-level programmers shouldnt use it.

Last edited by TheAMIgaOne on 18-Feb-2012 at 04:54 AM.

_________________
Cross-developer on Windows, OS3, OS4, Linux; Current Projects:-
Nephele Cloud App OS4
UserProfile System OS4
AmigaOneXE OS4.1.6

TaoSoftwareBlog Youtube

 Status: Offline
Profile     Report this post  
olegil 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 7:54:59
#5 ]
Elite Member
Joined: 22-Aug-2003
Posts: 5416
From: Work

@Hypex

There are levels of abstraction. wget is a lightweight command, so using it to get a file isn't bad. DNS lookup and general latency costs much more in any transaction.

But if you want to get down to it, open a tcp socket, connect to the server and send

"get path/to/file HTTP/1.1
host: servername.domain

"

Skip down to after first empty line of response and keep the rest
A webserver is simply a program that listens for connections and parses those two lines.
You can do all sorts of advanced features like compression etc, but they aren't NECESSARY.

_________________
Idea for "cheap" card using P2040/41 running multiple OSes and/or SMP OSes.

Anyone interested?

 Status: Offline
Profile     Report this post  
Petah 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 10:16:32
#6 ]
Regular Member
Joined: 10-Mar-2003
Posts: 289
From: Sweden, EU

One explanation would be that the "developers" of AmigaOS software in 2012 tend to favor AMOS-style hack-languages like "Hollywood" over proper C. After all, reading tutorials is tiresome and doesn't allow for quick results. Small, tight binaries with low stack size requirements, proper Amiga Style Guide UI compliancy and pretty, custom made icons don't seem to be of much value this spring.

_________________
That'll Put Marzipan In Your Pie Plate, Bingo

 Status: Offline
Profile     Report this post  
opi 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 10:28:42
#7 ]
Team Member
Joined: 2-Mar-2005
Posts: 2752
From: Poland

@Petah

Well, to be honest, I don't see reason to write your own HTTP handling code. Sure, getting data with GET /file.lha is easy, but what about 30x headers? Resuming? There's libcurl for that.

_________________
OpenWindows Initiative. Port PS3 hardware to bananas. For free. Join today and receive expired $50 cupon from AI!

 Status: Offline
Profile     Report this post  
nbache 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 11:00:04
#8 ]
Cult Member
Joined: 8-Apr-2003
Posts: 840
From: Copenhagen, Denmark

@Hypex

Well, I have to admit, like some of the other posters, I don't see a big problem with that. Especially as wget is widely used also on other systems for that purpose, and even meant for it.

Personally, I'd probably prefer getting my hands dirty in some real socket programming (if and when I get around to doing some network code on the Amiga), but I'm a bona fide nerd. I've used the TCP: handler in ARexx scripts at some earlier occasions, and do lots of TCP/IP code on other platforms at work (including from Oracle PL/SQL - doesn't get much more nerdy than that ).

But with wget (or curl, for that matter), people can concentrate on other aspects of their program, if network programming isn't their personal idea of heaven. More power to them, I say.

And finally, I do believe this is "the Amiga way": Making use of the components already available and the easy ways of making them cooperate which AmigaOS provides. And when those ways either are not enough, or you just don't want to bother setting them up or writing a script or program to bundle them into a reusable tool, using one application or command to produce a result which another one (started manually) can read and work further on is normally also simple and functions well, because the Amiga culture has nurtured ideas like open file formats and common naming standards and similar concepts.

This is also why I'm not particularly fond of the opposite approach, as exemplified by Jack (sorry djrikki, nothing personal, and I do have great respect for your effort, just not my personal cup of tea), where one monolithic program absolutely has to be able to do everything and clean the kitchen sink.

Best regards,

Niels

 Status: Offline
Profile     Report this post  
Antique 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 11:03:52
#9 ]
Cult Member
Joined: 9-Jun-2005
Posts: 861
From: Norway

@Hypex

I am one of those using wget for my program. And i'm programming in C. The reason is simple. I' ve never made anything network related, so uisng wget saves me for muuuuuch work and time to spent on other things.
Ofcourse i'd love to make my own internet programming. Until that i will use wget. And it does the job for me.

_________________
I'm an antique. Don't light my fuse

 Status: Offline
Profile     Report this post  
Kicko 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 11:15:38
#10 ]
Elite Member
Joined: 19-Jun-2004
Posts: 4797
From: Sweden

Wget is used widely. I have used it for ages and many apps uses it. Its just installing it in C: dir and let the apps use it. The bonus is i can use wget to download from shell when i want to.

So i dont see it any difference then having dir command in c:

EDIT: Mostly i use it together with clipdown to get big files as downloading with a browser would mean you have to keep it open until download is finished.

Last edited by Kicko on 18-Feb-2012 at 11:17 AM.

 Status: Offline
Profile     Report this post  
Chris_Y 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 13:20:11
#11 ]
Elite Member
Joined: 21-Jun-2003
Posts: 2872
From: Beds, UK

@Hypex

I sometimes get lazy and use my http-handler, because writing network code is a PITA if you only want to grab a quick file. I can see why people use WGet, and from scripts it's fine, but for "proper" code, I'd suggest to use http-handler - you can open web pages and hosted files as if they are local, using Open(), Read(), Skip() etc (only Lock() doesn't work, so you have to open a file and check the result, rather than locking it if you are not sure it exists, so dead easy to workaround). I've never used Hollywood but I don't see why it wouldn't work there too.

_________________
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar is Tabitha by Eric W Schwartz

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 13:47:57
#12 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@QuikSanz

Yes it could. Infact I've seen a HTTP server written in ARexx. And I have wrote my own open amd read TCP functions in ARexx uisng the TCP: handler.

But it still means an external program is used and a script is slower. So the main program might as well do the work instead by the same process.

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 13:59:50
#13 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@TheAMIgaOne

I'm talking about anything that is a binary really. I would have expected Hollywood to compile scripts as native executables with its overhead. But I also would have thought that TCP functions would be provvided.

On Linux WGet would seem to be unnecessary to me as mostly everything is opened as a file and I'd expect a URL to be handled as such without any work. Excepting TCP commands of course.

WGet may be widely used but is that needed? You look at its archive and it's confuisng. Where does the user put all those files? It's one of those problem ports where there is a mess of all files included and only one is used? Plus puting version numbers in dir names gives more of a rigid mess. Unlike Linux we don't exactly have a system to install these programs neatly and for use if sometihng needs it. That's my other problem with it.

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:03:26
#14 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@olegil

Exactly my point!

The same is done with the TCP: device. And on OS4 it works the same as any other. So this method has been around for years. And I've used it that way myself in a script.

So to me it didn't look that hard.

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:10:53
#15 ]
Elite Member
Joined: 9-Jun-2004
Posts: 9566
From: Norway

@Hypex

Wget can resume downloading files, is files was not downloaded complete, or download was paused, that’s way I use it and I don't need to worry about that CTRL+C signal sent when connection is broken... way oh way....

_________________
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.
http://lifeofliveforit.blogspot.no/

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:12:25
#16 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@Petah

In that case these languages should already include these feaures. Since they ar emade to make it easier on the coder.

But when I compare in my argument comparing using TCP: to using WGet I see a lot more work in using the DOS API to invoke the WGet command in a hidden shell then grab the result. Okay Execute() can be used but that way is not reccomended any more and using the modern function is a bit of work. Plus you have to be sure it's in the path and works. Also it would make sense to make it resident.

After testing this myself I'd find TCP: less work! Of course I know about it but it wasn't that much to learn.

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:17:27
#17 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@nbache

WGet is available but AFAIK not part of the OS. We also have OpenURL for the task. I suppose mainly it would be good if we had a static or link lib that included the WGet functionality in it to provide a cleaner approach.

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:18:56
#18 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@Antique

I've never learnt proper network programming either. Which is why I was using the TCP: device.

 Status: Offline
Profile     Report this post  
Hypex 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:21:50
#19 ]
Elite Member
Joined: 6-May-2007
Posts: 6450
From: Greensborough, Australia

@Kicko

Quote:
So i dont see it any difference then having dir command in c:


Bit Dir is made for a CLI. And by comparison if a program called Dir and examined its output to grab a directory listing rather than use the DOS API for the job I'd consider that quite bad!

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: What's with all these program needing WGet?
Posted on 18-Feb-2012 14:21:59
#20 ]
Elite Member
Joined: 9-Jun-2004
Posts: 9566
From: Norway

@Hypex

OpenURL only start a browser whit that given URL, it deigned to download files.

_________________
Please check out my software:
Excalibur, Basilisk 2, AmigaInputAnywhere.
http://lifeofliveforit.blogspot.no/

 Status: Offline
Profile     Report this post  
Goto page ( 1 | 2 | 3 Next Page )

[ home ][ about us ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright © 2000 - 2011 Amigaworld.net.

Page took 0.14856 seconds to load.