pjw wrote: ↑Fri May 12, 2023 1:56 pm
XorA wrote: ↑Fri May 12, 2023 1:27 pm
Sparrowhawk wrote: ↑Thu May 11, 2023 4:37 pm
Thank you both.
With regards being careful, it's a disk image so i can take backups easily first.
So just use a hex editor
Sure but this code should work just as well with real hardware. And you dont need to know anything about floppies to use it. For example a hex editor wont tell the user that the name must be limited to ten char..
I just cant help myself when Im having fun!
Virtual disks are another matter. They can be treated like just any ordinary file. The code below is a no-nonsense routine to rename virtual QL5-type floppy files of any density - S, D, H, and E. The usual caveats and precautions apply!
Code: Select all
100 REMark Rename virtual QL5-type floppy of any density
110 :
120 ERT VirtualFlpRen("dos1_tmp_flpE.img", "New name")
130 PRINT 'Done!'
140 :
150 DEFine FuNction VirtualFlpRen(filename$, newname$)
160 LOCal ch, n$(10)
170 ch = FOPEN(filename$): IF ch < 0: RETurn ch
180 IF FLEN(#ch) < 1024: CLOSE#ch: RETurn -16
190 :
200 BGET#ch; n$(1 TO 4): n$(0) = 4
210 IF n$ <> 'QL5A' AND n$ <> 'QL5B' THEN
220 CLOSE#ch: RETurn -19
230 END IF
240 :
250 n$ = newname$ & FILL$(" ", 10): REMark Pad to 10 char, if needed
260 BPUT#ch\ 4, n$
270 CLOSE#ch: RETurn 0
280 END DEFine VirtualFlpRen
290 :
Just take care you dont try to
mount an Extended virtual floppy into QPC2 with the built-in driver: It crashes the system!
To use Extended virtual floppies in QPC2 and SMSQmulator you could try Martin Head's FDI floppy driver (from Dr Dilwyn's). That allows you to create, format and use virtual drives of all "legal" densities.