;======================================
; pwd.s (loader for pwd_main)
;======================================

program pwd

include library
include prosys

data word diskutils="1:diskutils.c"
data word pwdmain="1:pwd_main.c"

word f

;======================================

begin

;load diskutils module, don't execute:
f=open(diskutils)
if f=0 and ioerror=4 ;file not found
  m[diskutils]='0'
  f=open(diskutils)
  if f=0 and ioerror=4 ;file not found
    abort"#cCan't find #s, aborting!",diskutils+2
load diskutils,ldnogo
if lderr <> 0
  output"#c#s:",diskutils
  abort "#cload error #i, aborting!",lderr

;load main module, unloading this one,
;and pass control to it:
f=open(pwdmain)
if f=0 and ioerror=4 ;file not found
  m[pwdmain]='0'
  f=open(pwdmain)
  if f=0 and ioerror=4 ;file not found
    abort"#cCan't find #s, aborting!",pwdmain+2
load pwdmain
if lderr <> 0
  output"#c#s:",pwdmain
  abort "#cload error #i, aborting!",lderr

end
