1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-14 12:04:03 +00:00
Files
PDP-10.its/src/sysen3/dircop.2
Lars Brinkhoff d6e288e375 Enhance DIRCPY to get source and destination from JCL.
Also handle directories on devices other than DSK:
2017-02-27 07:19:59 -08:00

122 lines
1.5 KiB
Groff
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
title DIRCPY, copy a directory to another
A=1
B=2
C=3
D=4
E=5
T=6
TT=7
P=17
CHDIRI=10
CHDSKI=11
CHDSKO=12
.INSRT SYSENG;FSDEFS >
$$RFN==1
.INSRT SYSENG; RFN >
PDL: -20,,.
BLOCK 20
JCL: BLOCK 20
indev: sixbit /DSK/
indir: sixbit /FOO/
outdev: sixbit /DSK/
outdir: sixbit /BAR/
FNAM:
DEV: 0
FN1: 0
FN2: 0
SNAM: 0
DIR: BLOCK 2000
BUF: BLOCK 2000
GO: .CLOSE 1, ;RUNS AS DAEMON
MOVE P,PDL
PUSHJ P,PARSE
CHKDIR: .CALL [ SETZ ? SIXBIT/OPEN/
[.BII,,CHDIRI]
INDEV
[SIXBIT/.FILE./]
[SIXBIT/(DIR)/]
SETZ INDIR]
.LOSE 1400
MOVE TT,[-2000,,DIR]
.IOT CHDIRI,TT
.CLOSE CHDIRI,
MOVE D,UDNAMP+DIR
CHKFIL: CAIL D,2000
.logout 1,
tlne tt,unigfl ;ignored?
jrst nxtfil ; yes, skip it
.CALL [ SETZ ? SIXBIT/OPEN/
[.BII,,CHDSKI]
INDEV
UNFN1+DIR(D)
UNFN2+DIR(D)
SETZ indir ]
.LOSE 1400
.CALL [ SETZ ? SIXBIT/OPEN/
[.BIO,,CHDSKO]
OUTDEV
[SIXBIT/_DIRCP/]
[SIXBIT/OUTPUT/]
setz outdir ]
.LOSE 1400
CPYFIL: MOVE TT,[-2000,,BUF]
.IOT CHDSKI,TT
MOVEI T,-BUF(TT)
JUMPE T,ENDFIL
MOVNS T
MOVSS T
HRRI T,BUF
.IOT CHDSKO,T
JRST CPYFIL
ENDFIL: .CLOSE CHDSKI,
.CALL [ SETZ ? 'RENMWO
MOVEI CHDSKO
UNFN1+DIR(D)
SETZ UNFN2+DIR(D) ]
.LOSE 1000
.CLOSE CHDSKO,
NXTFIL: ADDI D,LUNBLK
JRST CHKFIL
PARSE: .BREAK 12,[..RJCL,,JCL]
MOVE D,[440700,,JCL]
MOVEI B,FNAM
PUSHJ P,RFN"RFN
CAIE A,",
.LOSE
SKIPE A,DEV
MOVEM A,INDEV
SKIPN A,SNAM
MOVE A,FN1
MOVEM A,INDIR
MOVEI B,FNAM
PUSHJ P,RFN"RFN
SKIPE A,DEV
MOVEM A,OUTDEV
SKIPN A,SNAM
MOVE A,FN1
MOVEM A,OUTDIR
POPJ P,
RSIXTP: CAIN A,",
AOS (P)
POPJ 17,
END GO