QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


SMSQ File System Funnies

The following information was gleaned from Tony Tebby by Jochen Merz after I reported a problem where SMSQ systems refuse to accept a file (created on a QDOS system) which has CHR$(0) or CHR$(1) in the file name. This problem was brought to light when Dilwyn Jones tried to put WinBack 2 on his web site.

The code $01 is used internally to indicate the start of an MSDOS filename extension ($00 is used internally to as a directory separator '\' for DOS '/' for Unix and '_' for QDOS).

At the moment a $01 in a filename is translated to $01 and this does not seem to cause any problem for DV3 which just creates a file with a null extension. It might, however, cause a problem for reading old QL disks.

A fix is not obvious. In principle, the use of control codes in filenames is a bad idea.

There is a patch (below) which swaps $01 for '_' internally for QDOS filenames only. I have not been able to find any nasty side effects. This will, however, not deal with a filename with a CHR$(0) in it!!!

This patch can be used on SMSQ files howver, it is not advisable to use it if you are using Marcel's excellent QPC as that uses a different version of SMSQ and the offsets may not match up.

The Problem

WinBack 2 introduced the concept of being able to split large files over a number of floppies. As far as I remember, a maximum of 95 sections was allowed, each being named as the original filename plus '!' plus CHR$(1) to CHR$(94) and then CHR$(96). (CHR$(95) is missed out).

This worked fine on QDOS systems and all the file header details for the original massive file on the hard disc were stored in the header for the file with CHR$(1) in its name. So far so good…..

SMSQ came along and Tony appeared to use CHR$(1) in a filename to mark the start of an MSDOS filename extension (does he mean the dot in abcd.exe perhaps?) so this has totally mucked up the JoinFile utility (and WinBack's Split facility) until such time as I fix it again!

The Patch

I have not tried this patch yet. You are advised to use it on a backup until you know that it works.

100 REMark - This patch should allows DV3 drivers to handle files
110 REMark - with chr$(1) in the name without creating a dummy extension
120 :
125 REPeat
130   INPUT 'SMSQE Filename> ';fn$
140   IF fn$='': QUIT
150   fch = FOPEN (fn$)
160   IF fch<0: PRINT fn$;' ': REPORT fch: NEXT
170   fl = FLEN (#fch)
180 :
190   FOR fps1 = $8 TO fl-$280 STEP 2
200     GET #fch\(fps1), ck1%,ck2%,ck3%
210     IF ck1% = $5E00
220       IF ck2% = $6061 AND ck3% = $6263
230         GET #fch\(fps1+$100), ck1%
240         GET #fch\(fps1+$200), ck2%
250         IF ck1% = $5e5f and ck2% = $5e5f:  EXIT fps1
260       END IF
270     END IF
280   END FOR fps1
300   IF fps1 >= fl-$280
310     CLOSE #fch
320     PRINT 'Unknown Version'
330   ELSE
340     WPUT #fch\fps1-$5E, $005F
350     WPUT #fch\fps1+$100, $5E01
360     WPUT #fch\fps1+$200, $5E01
370     CLOSE #fch
390     QUIT
400   END IF
410 END REPeat
qdosmsq/fs/funny.txt · Last modified: 2009/01/30 12:16 by norman