MODULE BootManager;
IMPORT Commands, Files;
PROCEDURE Split* (context: Commands.Context);
VAR fileName: Files.FileName;
fi, fo, fo2 : Files.File; r : Files.Reader; w : Files.Writer;
count : LONGINT; ch : CHAR;
BEGIN
context.arg.SkipWhitespace; context.arg.String (fileName);
fi := Files.Old(fileName);
fo := Files.New("BootManagerMBR.Bin");
fo2 := Files.New("BootManagerTail.Bin");
IF fi # NIL THEN
Files.OpenReader(r, fi, 0);
Files.OpenWriter(w, fo, 0);
FOR count := 1 TO 512 DO
r.Char(ch);
w.Char(ch);
END;
w.Update;
Files.Register(fo);
Files.OpenWriter(w, fo2, 0);
FOR count := 1 TO 12 * 512 DO
r.Char(ch);
w.Char(ch);
END;
w.Update;
Files.Register(fo2);
END;
END Split;
BEGIN
END BootManager.
BootManager.Split BootManager.Bin ~