;======================================
; ls.s (loader for ls_main)
;======================================

program ls

include library
include prosys

data word diskutils="1:diskutils.c"
data word lsmain="1:ls_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(lsmain)
if f=0 and ioerror=4 ;file not found
  m[lsmain]='0'
  f=open(lsmain)
  if f=0 and ioerror=4 ;file no found
    abort"#cCan't find #s, aborting!",lsmain+2
load lsmain
if lderr <> 0
  output"#c#s:",lsmain
  abort "#cload error #i, aborting!",lderr

end
