rjget is a tiny wget for the Amiga CLI: it fetches a file over HTTP and
saves it to disk. One executable of 7 KB, no installer, no extra libraries.
rjget http://server/dl/disk1.adf
rjget http://server/dl/disk1.adf TO RAM:disk1.adf
rjget http://server/dl/disk1.adf RESUME
rjget http://server/dl/disk1.adf QUIET
WHAT YOU NEED
- An Amiga: it is built for the 68000, so any model should do.
- Kickstart 2.04 or later.
- A TCP/IP stack that is running and provides bsdsocket.library: AmiTCP,
Miami, Genesis, Roadshow...
Copy rjget to C: (or anywhere in your path).
USAGE
rjget URL [TO file] [RESUME] [QUIET]
URL http://host[:port]/path. The "http://" can be left out. Put the
URL in quotes if it has a ? or a = in it, or the shell will take
them for its own.
TO Where to save. Without it, the file gets the name it has in the
URL and goes to the current directory.
RESUME Go on from what is already saved, after a download that was
interrupted.
QUIET Print nothing unless something goes wrong. For scripts.
"rjget", "rjget help" or "rjget -h" print the help. "rjget ?" shows the
argument template, as every AmigaDOS command does.
While it downloads it shows the bytes received, the percentage and the
speed. Ctrl-C stops it and tells you how much was saved, so that RESUME can
go on from there.
The file is written to disk as it arrives: its size does not matter,
however little memory you have.
Return codes:
0 The file is complete.
5 Stopped with Ctrl-C.
10 The connection broke or the server stopped early: part of the file
is saved.
20 Nothing was fetched: bad URL, host not found, no connection, an
error from the server.
WHAT IT DOES NOT DO
- No HTTPS: plain HTTP only. A server that redirects everything to
https:// cannot be used.
- No FTP, no proxy, no passwords, no cookies.
- One file at a time.
It follows redirections (up to five) as long as they stay on HTTP.
SOURCE
The source (one C file, MIT license) is at
https://github.com/Yuki-RJ/rjget
It uses no C library, only exec, dos and bsdsocket. It is built with
m68k-amiga-elf-gcc and elf2hunk, the toolchain of the "amiga-debug"
extension for Visual Studio Code.
TESTED ON
An Amiga 4000/030 with AmiTCP, and WinUAE with its bsdsocket.library
emulation.
Ram Jam - Taste The Difference -
http(s)://www.ramjam.it
|