Hi Martyn,martyn_hill wrote: ↑Sat Apr 20, 2024 6:03 pm Hi Per
I don't have the answer, but wondered if you were trying to do what I wanted-to recently, i.e. to change the embedded Volume name of a WIN Container file - you'd expect to be able to set the Volume name at point of FORMAT, but you seem only able to set the volume size in the format string and the Volume name always ends up as simply WIN1 or whatever the container was mounted at at the time of format.
Is that what you were trying to do, as well?
No, that one was sorted long ago. The hack below works on QPC2 and SMSQmulator and possibly elsewhere. (Use at own risk!)
But Q68 is different in that its virtual container files dont appear to be accessible in the same way. On the Atari, which uses real hard disks, sector #0 led you to the partition table, which you had to navigate in order to get to the QLWA disk partition, but youd end up with a routine similar to this one.
So here goes:
Code: Select all
100 REMark WIN hard disk rename
110 REMark pjwitte 1998, 2o2o
120 REMark V0.05, Set length word debugged
130 :
140 ch = 1: namel% = 20: esc$ = CHR$(27)
150 CLS#ch
160 PRINT#ch; ' Rename harddisk'
170 PRINT#ch; 'Note: No other application'
180 PRINT#ch; 'may access the hard disk'
190 PRINT#ch; 'during this call'
200 PRINT#ch\\ 'Enter drive number <1..8> ';
210 CURSEN#ch
220 REPeat
230 n$ = INKEY$(#ch; -1)
240 IF n$ INSTR '12345678' & esc$: EXIT
250 BEEP 2000, 200
260 END REPeat
270 CURDIS#ch: BEEP 2000, 2
280 IF n$ = esc$: PRINT#ch; '^ESC': STOP
290 PRINT#ch; n$
300 w = FOPEN("win" & n$ & '_*D2d')
310 IF w = -9 THEN
320 PRINT#ch; 'HD is in use. Close all open'
330 PRINT#ch; 'channels on this drive and'
340 PRINT#ch; 'then try again.': STOP
350 ELSE : IF w < 0: ERT w
360 END IF
370 GET#w\ 0; sec$
380 IF sec$(1 TO 4) <> 'QLWA' THEN
390 PRINT#ch; 'Unsupported hard disk format:' !n$: CLOSE#w: STOP
400 END IF
410 n$ = sec$(7 TO 6 + namel%)
420 PRINT#ch\\ 'Current name is "'; n$; '"'
430 PRINT#ch\\'Enter new name (max'! namel%! 'chars)'
440 INPUT#ch;, n$: n% = LEN(n$)
450 IF n% = 0: PRINT#ch; 'Aborted': CLOSE#w: STOP
460 IF n% < namel% THEN
470 n$ = n$ & FILL$(' ', namel% - n%)
480 ELSE
490 IF n% > namel%: n$ = n$(1 TO namel%): n% = namel%
500 END IF
510 sec$ = 'QLWA' & CHR$(0) & CHR$(n%) & n$ & sec$(27 TO 512)
520 PRINT#ch; 'Writing...'
530 PUT#w\ 0; sec$: CLOSE#w
540 PRINT#ch\\ 'Done': BEEP 2000, 2
550 :