Out of space on qxl.win file

Discussion and advice about emulating the QL on other machines.
Post Reply
RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Out of space on qxl.win file

Post by RWAP »

Here is a quick question - how do you extend a qxl.win file to make it bigger?

Hopefully, the answer is not to create a new one and then copy all the files over - I seem to remember QTOP can do this, retaining all of hte sub-directories, but can't remember!


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Out of space on qxl.win file

Post by pjw »

RWAP wrote:Here is a quick question - how do you extend a qxl.win file to make it bigger?

Hopefully, the answer is not to create a new one and then copy all the files over - I seem to remember QTOP can do this, retaining all of hte sub-directories, but can't remember!
Sorry, but that is the correct answer ;) However, it is no big deal as the hack below demonstrates:
(The following for QPC2 only)

WIN_DRIVE 8, "C:\QL\Win\New.win"
WIN_FORMAT 8, 1
FORMAT 'win8_<new size in Mb>'

Code: Select all

10 REMark QLone a drive - Use at own risk!
11 :
12 source$ = 'win2_': dir$ = ''
13 target$ = 'win8_'
14 :
15 CLS
16 PRINT 'Press <ENTER> to clone'! source$; dir$! 'to'! target$!: INPUT r$
17 IF r$ <> '': STOP
18 :
19 dcount = 0: fcount = 0: ttaken = DATE
20 ERT QLone(source$, dir$, target$)
21 PRINT\ 'Done!'
22 PRINT dcount! 'directories created'\ fcount! 'files copied'
23 PRINT 'Time taken'! (DATE - ttaken);'s'
24 :
25 DEFine FuNction QLone(sdv$, dir$, tdv$)
26 LOCal ch, lp, fl, ps, er, ty%, nm$
27 REMark GLObal counts
28 REMark Scan source directory tree and
29 REMark Create correponding structure under target
30 REMark Backup files, maintaining date
31 REMark V0.00, pjwitte, January 30th 2015
32 :
33 ch = FOP_DIR(sdv$ & dir$): IF ch < 0: RETurn ch
34 :
35 ps = 0: er = 0: fl = FLEN(#ch)
36 REPeat lp
37  IF ps >= fl: EXIT lp
38  GET#ch\ ps + 14; nm$: l% = LEN(nm$)
39  IF l% > 0 THEN
40   BGET#ch\ ps + 5, ty%
41   IF ty% = 255 THEN
42    PRINT 'Creating: >'! tdv$; nm$
43    er = FMAKE_DIR(tdv$ & nm$): IF er = -8: er = 0
44    IF er < 0: RETurn er
45    dcount = dcount + 1
46    er = QLone(sdv$, nm$, tdv$)
47   ELSE
48    PRINT 'Copying:'! sdv$; nm$! '..'
49    COPY_O sdv$ & nm$ TO tdv$ & nm$
50    SET_FUPDT \tdv$ & nm$, FUPDT(\sdv$ & nm$)
51    fcount = fcount + 1
52   END IF
53  END IF
54  IF er < 0: EXIT lp
55  ps = ps + 64
56 END REPeat lp
57 CLOSE#ch
58 RETurn er
59 END DEFine QLone
60 :
Then remember to give your new drive a sensible name:

Code: Select all

10 REMark Rename QLWA Hard drive
11 REMark V0.00, pjw
12 REMark No channels must be open on hard drive!
13 :
14 drive% = 8         : REMark Drive number 1..8
15 name$ = 'Testing'  : REMark New name
16 maxnl% = 10        : REMark MAX name length = 10
17 :
18 name$ = name$ & FILL$(' ', maxnl%)
19 cw = FOPEN("win" & drive% & '_*D2d'): ERT cw
20 GET#cw\ 0; sec$
21 IF sec$(1 TO 4) <> 'QLWA': CLOSE#cw: ERT -12
22 :
23 sec$ = sec$(1 TO 6) & name$(1 TO maxnl%) & sec$(17 TO LEN(sec$))
24 PUT#cw\ 0; sec$
25 CLOSE#cw
26 :
QLWA accepts up to 20 chracters medium name, but only the first 10 display in DIR, QPAC, etc


Per
dont be happy. worry
- ?
User avatar
tofro
Font of All Knowledge
Posts: 2687
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Out of space on qxl.win file

Post by tofro »

Rich,

I'm afraid that answer is the answer.

I am not aware of any possibility that an emulator could extend a native file (which would be needed to do such things). Thus, I'm pretty sure QTop would not be able to do that.

There is, however, a number of very nice backup programs around that actually make that undertaking extremely easy. Look here

http://www.dilwyn.me.uk/backup/

And I just saw Per's program - nice piece of recursive S*Basic programming, Per!

Regards,
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Out of space on qxl.win file

Post by pjw »

tofro wrote: <>
And I just saw Per's program - nice piece of recursive S*Basic programming, Per!
Thanks. A benefit of publicizing is that one sees one's code anew, as if through the eyes of others (or so it seems to me). Hence I detected the following tweak (re QLone code above):

Code: Select all

26 LOCal ch, lp, fl, ps, er, dt, ty%, nm$
..
49    LGET#ch\ ps + 52; dt
50    COPY_O sdv$ & nm$ TO tdv$ & nm$
51    SET_FUPDT \tdv$ & nm$, dt
52+
Apologies for any nit-picking ;)


Per
dont be happy. worry
- ?
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Out of space on qxl.win file

Post by NormanDunbar »

I haven't seen Per''s program, but I know it will be good!

My own WinBack available from Dilwyn site linked above, has a utility to prevent your recreation of the old data on the new disc from leaving lots and lots of empty spaces in the directory, as happens when you create the files first, then create the directories afterwards. Wasted space takes up more of your hard drive and extends the size of the main directory hugely. This slows down access via the directory as the blank entries are read and skipped. I did some testing of this back in the early 1990s.

Run the utility, rebuild_directory_structure, to create a SuperBasic program to recreate all your source drives directory structure first. Run the generated program to build the empty tree, then you can wcopy or WinBack the source drive to the newly created, larger, destination drive.

HTH.

Ps. There's some really nice recursive Super Basically code in the above utility, and in WinBack too! :D

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Out of space on qxl.win file

Post by RWAP »

Many thanks for all of the suggestions - Per's program is a winner and I have stored it here :D


Ralf R.

Re: Out of space on qxl.win file

Post by Ralf R. »

Does COPY_O preserve the file version? When Arvid Borretzen once has written his harddisk copy program, I suggested to take SG's GETHEAD an SETHEAD extensions to patch the file header after copying to preserve all extra Information. That was a good workaround.

I am not sure about FUPDT increasing the version...?


Post Reply