Click Here
home features news forums classifieds faqs links search
6071 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
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
13 crawler(s) on-line.
 110 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 CosmosUnivers:  10 mins ago
 amigakit:  15 mins ago
 pavlor:  45 mins ago
 Rob:  1 hr 45 mins ago
 agami:  4 hrs 27 mins ago
 wakido:  6 hrs 35 mins ago
 bhabbott:  6 hrs 38 mins ago
 Karlos:  7 hrs 45 mins ago
 OneTimer1:  8 hrs 14 mins ago
 Matt3k:  10 hrs 3 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: 11222
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 ]
Cult Member
Joined: 23-Feb-2010
Posts: 517
From: Victoria, Australia

@Hypex

Feel better now LOL.

_________________
Amiga A1200T - TF1260 - R9200 - Indivision AGA MK3
Amiga A500 - PiStorm EMU68
Pegasos 2 G4 - AmigaOS 4.1 FE / MorphOS 3.16

 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 ]
Super Member
Joined: 28-Mar-2003
Posts: 1236
From: Harbor Gateway, Gardena, 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: 776
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: 5895
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.

_________________
This weeks pet peeve:
Using "voltage" instead of "potential", which leads to inventing new words like "amperage" instead of "current" (I, measured in A) or possible "charge" (amperehours, Ah or Coulomb, C). Sometimes I don't even know what people mean.

 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: 432
From: EU <3 ❤️

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
💻 Pro-Amiga, 🌍 Pro-Globalism, 🍅 Pro-Vegan, 🛦 Pro-NATO & 🇪🇺 Pro-Joint EU Defense Intervention Initiative

 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 ]
Super Member
Joined: 8-Apr-2003
Posts: 1034
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: 887
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: 5009
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: 3203
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: 11222
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: 11222
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: 11222
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: 12820
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....

_________________
http://lifeofliveforit.blogspot.no/
Facebook::LiveForIt Software for AmigaOS

 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: 11222
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: 11222
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: 11222
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: 11222
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: 12820
From: Norway

@Hypex

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

_________________
http://lifeofliveforit.blogspot.no/
Facebook::LiveForIt Software for AmigaOS

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

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle