win_extender_bas
Posted: Wed Jan 04, 2017 7:52 pm
Hi can you help me when I use the extender to make my WIN File Bigger I get an Error Message some think about Copy in use can any one help me OK thank you Simon Foster
Code: Select all
1 drive% = 8 : REMark Drive number 1..8
2 name$ = 'BigQLE' : REMark New name
3 driveSize% = 200 : REMark Size of new Drive in MB
4 existingDrive% = 1 : REMark Drive number to be extended
100 WIN_DRIVE drive%, "C:\New.win"
110 WIN_FORMAT drive%, 1
120 FORMAT 'win'&drive%&'_'&driveSize%
130 :
140 REMark QLone a drive - Use at own risk!
150 :
160 source$ = 'win'&existingDrive%&'_': dir$ = ''
170 target$ = 'win'&drive%&'_'
180 :
190 CLS
200 PRINT 'Press <ENTER> to clone'! source$; dir$! 'to'! target$!: INPUT r$
210 IF r$ <> '': STOP
220 :
230 dcount = 0: fcount = 0: ttaken = DATE
240 ERT QLone(source$, dir$, target$)
250 PRINT\ 'Done!'
260 PRINT dcount! 'directories created'\ fcount! 'files copied'
270 PRINT 'Time taken'! (DATE - ttaken);'s'
275 RenameWin drive%, name$
280 :
290 DEFine FuNction QLone(sdv$, dir$, tdv$)
300 LOCal ch, lp, fl, ps, er, dt, ty%, nm$
310 REMark GLObal counts
320 REMark Scan source directory tree and
330 REMark Create correponding structure under target
340 REMark Backup files, maintaining date
350 REMark V0.00, pjwitte, January 30th 2015
360 :
370 ch = FOP_DIR(sdv$ & dir$): IF ch < 0: RETurn ch
380 :
390 ps = 0: er = 0: fl = FLEN(#ch)
400 REPeat lp
410 IF ps >= fl: EXIT lp
420 GET#ch\ ps + 14; nm$: l% = LEN(nm$)
430 IF l% > 0 THEN
440 BGET#ch\ ps + 5, ty%
450 IF ty% = 255 THEN
460 PRINT 'Creating: >'! tdv$; nm$
470 er = FMAKE_DIR(tdv$ & nm$): IF er = -8: er = 0
480 IF er < 0: RETurn er
490 dcount = dcount + 1
500 er = QLone(sdv$, nm$, tdv$)
510 ELSE
520 PRINT 'Copying:'! sdv$; nm$! '..'
530 LGET#ch\ ps + 52; dt
540 COPY_O sdv$ & nm$ TO tdv$ & nm$
550 SET_FUPDT \tdv$ & nm$, dt
560 fcount = fcount + 1
570 END IF
580 END IF
590 IF er < 0: EXIT lp
600 ps = ps + 64
610 END REPeat lp
620 CLOSE#ch
630 RETurn er
640 END DEFine QLone
650 :
660 REMark Rename QLWA Hard drive
670 REMark V0.00, pjw
680 REMark No channels must be open on hard drive!
690 :
700 DEFine PROCedure RenameWin(drive%,name$)
720 maxnl% = 10 : REMark MAX name length = 10
730 :
740 name$ = name$ & FILL$(' ', maxnl%)
750 cw = FOPEN("win" & drive% & '_*D2d'): ERT cw
760 GET#cw\ 0; sec$
770 IF sec$(1 TO 4) <> 'QLWA': CLOSE#cw: ERT -12
780 :
790 sec$ = sec$(1 TO 6) & name$(1 TO maxnl%) & sec$(17 TO LEN(sec$))
800 PUT#cw\ 0; sec$
810 CLOSE#cw
815 END DEFine
820 :
This was but a hack, but Im preparing a more comprehensive solution right now, and this issue is warned against in the documentation. (I mentioned to Jim (of QDT fame), that the issue was problematic. The same for a certain flp device driver that needs a channel to remain open at all times.) Anyway, the solution is to exit QDT (or avoid booting it) for this operation. If you have QPAC2 loaded you could EXEP 'Channels' to se if any other files are open and close those channels. After the operation you can then exit and re-start QPC2.RWAP wrote: The error code is Line 540:1 Is In Use
This seems to occur when copying the QDT.log file which I assume is open in QDT.
Simon could try right click on the green QDT icon and then click on Quit before running the program (I assume that will release the log file).
However, suggestions are invited as to the best way to overcome this error on other possible files which are left open
Would anyone be prepared to help by testing it? (QPC2 only at present)pjw wrote:Im preparing a more comprehensive solution right now
Why dont you try it and see?Ralf R. wrote: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...?
The QDOS/SMS traps to set the version and update date were introduced in V2 drivers, after TK2 was written. I'm not sure about SG's utilities, but if they use the original FS.HEADS call they won't set the update date since this call only sets the first 14 bytes of the header (the update date will be set to the current time on TT's MDV and FLP drivers though).pjw wrote:Why dont you try it and see?Ralf R. wrote: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...?
Using GETHEAD an SETHEAD does preserve all extra information. One exception is, if you copy an old pre-V2 file with version "0", it is set to version *1*. But that is a minor thing.janbredenbeek wrote: The QDOS/SMS traps to set the version and update date were introduced in V2 drivers, after TK2 was written. I'm not sure about SG's utilities, but if they use the original FS.HEADS call they won't set the update date since this call only sets the first 14 bytes of the header (the update date will be set to the current time on TT's MDV and FLP drivers though).
I've never seen the various flavours of the TK2 COPY command preserving the original update date, even not on a Gold Card which supports V2 drivers.
The version number is increased every time you modify a file by writing to it. AFAIK setting the update date does not change the version count.
I dont have GET/SETHEAD, but you might want to see if it keeps incrementing the version number beyond 1, as SMSQ/E's HPUT/GET does. SET_FUPDT and SET_FBKDT dont affect the version number.Ralf R. wrote:Using GETHEAD an SETHEAD does preserve all extra information. One exception is, if you copy an old pre-V2 file with version "0", it is set to version *1*. But that is a minor thing.
Code: Select all
10 REMark QLone a drive
11 :
12 source$ = 'ram1_': dir$ = ''
13 target$ = 'ram2_'
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, dt, bd, 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 REMark V0.01, pjw, January 6th 2017, Sans FUPDT(), maintain FBKDT
33 :
34 ch = FOP_DIR(sdv$ & dir$): IF ch < 0: RETurn ch
35 :
36 ps = 0: er = 0: fl = FLEN(#ch)
37 REPeat lp
38 IF ps >= fl: EXIT lp
39 GET#ch\ ps + 14; nm$: l% = LEN(nm$)
40 IF l% > 0 THEN
41 BGET#ch\ ps + 5, ty%
42 IF ty% = 255 THEN
43 PRINT 'Creating: >'! tdv$; nm$
44 er = FMAKE_DIR(tdv$ & nm$): IF er = -8: er = 0
45 IF er < 0: RETurn er
46 dcount = dcount + 1
47 er = QLone(sdv$, nm$, tdv$)
48 ELSE
49 PRINT 'Copying:'! sdv$; nm$! '..'
50 LGET#ch\ ps + 52; dt
51 LGET#ch\ ps + 60; bd
52 COPY_O sdv$ & nm$ TO tdv$ & nm$
53 SET_FUPDT \tdv$ & nm$, dt
54 IF bd: SET_FBKDT \tdv$ & nm$, bd
55 fcount = fcount + 1
56 END IF
57 END IF
58 IF er < 0: EXIT lp
59 ps = ps + 64
60 END REPeat lp
61 CLOSE#ch
62 RETurn er
63 END DEFine QLone
64 :