Poster | Thread |
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 | | |
|
| |
Status: Offline |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 | | |
|
| |
Status: Offline |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 | | |
|
| |
Status: Offline |
|
|