a camel back home
Back Home

The Dead Letter Drop

aka Jonathan Hudson's Home Page

Last modified: Sun Jun 24 20:03:29 BST 2001

Perl article

The article here was first published in Quanta Jan'99. It describes the perl 4 port for QDOS.

Free Software

Linux and uqlx support packages are now in the Linux Page

Text manuals

Had a fax recently (September 1998) from a Mr R. G. Wall to say he couldn't get a QFAX text file from the HTML using QDOS lynx -dump. How sad ... html to text works fine on (all the usual suspects, Windows, Unix, VMS, AmigaOS etc).

Anyway, just in case you don't have access to a one of these capable operating system, here's the text manuals for QFAX and QTPI

Alternatively, just download the wonderful perl for qdos and use this simple 14 line perl script. Wow, isn't it wonderful having a real scripting language at last!


ex perl;'html2txt.pl <qtpi.html >qtpi.txt'

For at least an approximate translation.

GPL'ed QDOS source code is available for qtpi, qfax xpr-qdos and qvm. The qfax source is now at v2.89, which should compile on non-intel (big endian) Linux systems (e.g. Q40).

Other SMS/QDOS software can be found at ftp.demon.co.uk:/pub/qdos and ftp.nvg.unit.no:/pub/sinclair/ql.


InfoZIP logo Free and portable archiving tools (unzip 5.41 and zip 2.3). Full source code for numerous operating systems (including SMS/QDOS) from the Info-ZIP Home Site . The encrypting version of zip is available from the Info-ZIP Encryption Home Site. Unzip for SMS/QDOS is here as a self extracting (SFX) archive.

QDOS binary Info-ZIP Downloads:

If you have an existing version of unzip (or pkunzip, WinZip), then you can extract the archive using that software. Otherwise, LRESPR the SFX.

LRESPR unzip541xQ.bin
And following the on screen directions.

Alternately, the following perl script will unpack the archive.

#!/usr/contrib/bin/perl -w
# force perl4, alas

$fn = shift || die "unsfo filename [temp_dir [out_dir]]";
$wdir = shift;
$odir = shift;

  print "Scratch Directory ? ";
  chop ($wdir = <>);
  $wdir .= '_' unless $wdir =~ /_$/;
  print "Target Directory ? ";
  chop ($odir = <>);
  $odir .= '_' unless $odir =~ /_$/;

open(F,$fn) || die "Can't open ",$fn.' '.$!;
print "opened archive\n";
$buf = '' x 1024;

while ((read(F, $buf,2)))
  if (unpack("n",$buf) == 0x4afb)
    last if (read(F, $buf,2), unpack("n",$buf) == 0x4afb);

$base = tell(F) - 4;

  print "Found signature\n";
  ($offset,$sfxlen,$sfxdsiz,$sfxnam,$ziplen) = unpack("NNNNN",$buf);

  $dnam = $wdir."sfx.dat";
  $enam = $wdir."sfx.exe";
  print "writing extractor program\n";
  open(E,">".$enam) || die "Can't open sfx.exe $!";
  $buf = '' x $sfxlen;
  substr($buf,$sfxnam,length($dnam)+1) = $dnam."\0";
  print E $buf;
  $hdr = pack("NccNN",$sfxlen,0,1,$sfxdsiz,0);
  $res = syscall(3,0x46,0,0,-1,fileno(E),$hdr);
  close E;
  print "writing compressed data\n";
  open (E,">".$dnam);
  $buf = '' x $ziplen;
  print E $buf;
  close E;
    print "uncompressing files\n";
    system $enam." -d ".$odir;
    unlink $dnam;
    unlink $enam;
  warn "Doesn't look like a QDOS archive to me\n";

And here's the perl that processed the previous 5.32 sfx file.

#!/usr/contrib/bin/perl -w

sub setqhead
  local($f) = shift;
  $res = -1;

  open(F,$f) || die "Can't open your file $f ".$!;
  ($magic,$dspc) = unpack("a4N",$buf);
  if($magic eq "XTcc")
    $hdr = pack("NccNN",tell(F),0,1,$dspc,0);
    $res = syscall(3,0x46,0,0,-1,fileno(F),$hdr);
    die "Bad magic\n";
  close F;

$fn = shift || "ram2_unz532xQ.exe";
system ($fn) unless &setqhead($fn);
The above setqhead function may be used to set the QDOS file header for any xtc68 compiled program.


SMS and QDOS are operating systems for 680xx based computers, originally (popularised ?) by the Sinclair QL. Modern, debugged, compatible operating systems, supporting more recent, reliable hardware include SMS/2, SMSQ/E and Minerva.

SMS and QDOS Web Resources

BBS supporting SMS/QDOS users include (e&oe):

If you want to access the maus.computer.ql.intl newgroup, which is (allegedly) gated to FIDONET INTL.QL BBS area, then sign up for a free, posting allowed news account at news.cis.dfn.de. No Ads, no spam, just the news.
back home
Back Home