Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/libsim/rename.mac
There are 4 other files named rename.mac in the archive. Click here to see a list.
00100 COMMENT * SIMULA specification;
00200 OPTIONS(/E:CODE,NOCHECK,ZYLRNM);
00300 INTEGER PROCEDURE rename;!(fs1,fs2,force);
00400 !NAME fs1,fs2,force;
00500 !BOOLEAN force;
00600 !TEXT or REF(FILE) fs1;
00700 !TEXT fs2;
00800 COMMENT fs1 is either a file specification text or a reference to a file object.
00900 fs2 is a (partial) file specification. Missing fields are taken from fs1.
01000 Information from fs2 is substituted in fs1 and a RENAME UUO is executed.
01100 If fs2==NOTEXT, the file defined by fs1 is deleted.
01200 If force==TRUE, a RENAME changing only the protection is tried first, then
01300 a full RENAME.
01400 The result is -1 if RENAME worked, error code if not.
01500 Common error codes:
01600 ERFNF% 0 File not found (refers to first file)
01700 ERIPP% 1 Illegal path (ppn or full sfd path)
01800 ERPRT% 2 Protection failure
01900 ERAEF% 4 Already existing filename
02000
02100 Other error codes are listed in the DECsystem-10 Monitor Calls manual.
02200 ;
02300
02400 !*;! MACRO-10 code !*;!
02500
02600 TITLE rename
02700 ENTRY ZYLRNM
02800 SUBTTL SIMULA utility, Lars Enderin Sept 1977
02900
03000 ;!* Copyright 1977 by the Swedish Defence Research Institute. *
03100 ;!* Copying is allowed. *
03200
03300
03400 sall
03500 search simmac,simmcr,simrpa
03600 macinit
03700
03800 ;! Special error codes:
03900
04000 notdsk==1000
04100 reoper==1001 ;! Could not reopen fs1
04200 fs2err==1002 ;! Error in fs2
04300 deverr==1003 ;! Cannot change device
04400
04500 ;! Local definitions ;!
04600
04700 DEFINE error(code,label,op)
04800 < HRREI code
04900 IFNB <label>,<IFNB <op>,<op label>
05000 IFB <op>,<JSP XFP,label>>
05100 >
05200 DEFINE erret(c,l)<JSP XFP,[error(c,l,GOTO)]>
05300 DEFINE eval(x)
05400 < LI XWAC1,(XCB)
05500 HRLI XWAC1,x
05600 XEC PHFV
05700 Z
05800 >
05900 DEFINE normaltext
06000 < IF TLNN XWAC1,-1
06100 GOTO FALSE
06200 THEN XEC TXCY
06300 Z
06400 FI
06500 >
06600
06700 rbmax==.RBSIZ
06800 pthsav==rbmax+1
06900 rnsz==3+pthsav
07000 result==2
07100 fs1==result+1
07200 fs2==fs1+2
07300 force==fs2+2
07400
07500 OPDEF readjust [XEC renrea]
07600 OPDEF LOKUP [XEC .LOKUP]
07700 OPDEF RENAM [XEC .RENAM]
07800 IFN <%ZFIOP>,<PRINTX %ZFIOPN not bit zero as assumed>
07900 OPDEF IFOPEN [SKIPGE OFFSET(ZFIOPN)]
08000 OPDEF IFNOTOPEN [SKIPL OFFSET(ZFIOPN)]