home *** CD-ROM | disk | FTP | other *** search
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.File;
- import java.io.FileDescriptor;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.io.RandomAccessFile;
- import java.util.Enumeration;
- import java.util.Vector;
- import netrexx.lang.Rexx;
- import netrexx.lang.RexxParse;
- import netrexx.lang.RexxSet;
-
- public class RXFile {
- private int iLastErr;
- private long lWriteCurs = 1L;
- private long lReadCurs = 1L;
- private boolean bLastWasRead = true;
- private boolean bRWCurs = false;
- private Rexx rName;
- private RandomAccessFile rafStream;
- private DataInputStream disConsoleIn;
- private DataOutputStream dosConsoleOut;
- private FileDescriptor fdFileDescriptor;
- private FileInputStream fisFileInputStream;
- private FileOutputStream fosFileOutputStream;
- private char cNLn = '\n';
- private char cNLr = '\r';
- private Rexx rNLine;
- private int iNLRN = 1;
- private Rexx stemCursor;
- private String rReady = "READY:";
- private String rCommand = "c";
- private String rOpen = "open";
- private String rSeekAtZero = "seek =0";
- private String rRSeekAtZero = "rseek =0";
- private String rNumeric = "N";
- private String rWSeekAt = "wseek =";
- private String rSeekAt = "seek =";
- private static final Rexx $$8 = new Rexx('0');
- private static final Rexx $$9 = new Rexx('1');
- private static final Rexx $$10 = new Rexx('2');
- private static final Rexx $$11 = new Rexx("");
- private static final char[] $$25 = new char[]{'\u0001', '\n', '\u0002', '\u0000', '\u0001', '\u0000'};
- private static final Rexx $$36 = new Rexx(1);
- private static final Rexx $$37 = new Rexx('+');
- private static final Rexx $$39 = new Rexx('-');
- private static final Rexx $$179 = new Rexx(0);
- private static final Rexx $$219 = new Rexx(13);
- // $FF: renamed from: $0 java.lang.String
- private static final String field_0 = "RXFile.nrx";
-
- public Rexx[] filetree(Rexx var1) {
- Rexx[] var2 = new Rexx[1];
- Object var3 = null;
-
- try {
- var2[0] = this.Err(9, true);
- var5 = new File(var1.toString());
- } catch (NullPointerException var4) {
- return var2;
- }
-
- return this.StringArrayToRexxArray(var5.list());
- }
-
- public Rexx setparms(boolean var1, int var2) {
- if (this.rafStream != null) {
- return this.Err(8, true);
- } else {
- this.bRWCurs = var1;
- if (var2 == 0) {
- this.rNLine = new Rexx(this.cNLn);
- this.iNLRN = 0;
- } else if (var2 == 1) {
- this.rNLine = new Rexx(String.valueOf(this.cNLr) + this.cNLn);
- this.iNLRN = 1;
- } else {
- this.rNLine = new Rexx(this.cNLr);
- this.iNLRN = 2;
- }
-
- return this.Err(0, true);
- }
- }
-
- public Rexx getparms() {
- new Rexx("");
- Rexx var1;
- if (this.bRWCurs) {
- var1 = new Rexx('1');
- } else {
- var1 = new Rexx('0');
- }
-
- if (this.iNLRN == 0) {
- var1 = var1.OpCc((RexxSet)null, $$8);
- } else if (this.iNLRN == 1) {
- var1 = var1.OpCc((RexxSet)null, $$9);
- } else {
- var1 = var1.OpCc((RexxSet)null, $$10);
- }
-
- return var1;
- }
-
- public Rexx addcursor(Rexx var1, long var2) {
- if (var1 == null) {
- return this.Err(1, true);
- } else if (var1.OpEq((RexxSet)null, $$11) | var2 < 0L) {
- return this.Err(1, true);
- } else {
- this.stemCursor.getnode(var1).leaf = new Rexx(var2);
- return this.Err(0, true);
- }
- }
-
- public Rexx getcursor(Rexx var1) {
- if (var1 == null) {
- return this.Err(1, true);
- } else {
- return var1.OpEq((RexxSet)null, $$11) ? this.Err(1, true) : this.stemCursor.getnode(var1).leaf;
- }
- }
-
- public Rexx delcursor(Rexx var1) {
- if (var1 == null) {
- return this.Err(1, true);
- } else if (var1.OpEq((RexxSet)null, $$11)) {
- return this.Err(1, true);
- } else {
- this.stemCursor.getnode(var1).leaf = this.stemCursor;
- return this.Err(0, true);
- }
- }
-
- public Rexx delallcursors() {
- Object var1 = null;
- Rexx var2 = this.stemCursor;
- int var3 = 0;
- Vector var4 = new Vector(100, 1000);
- synchronized(var2){}
-
- try {
- Enumeration var7 = var2.keys();
-
- while(var7.hasMoreElements()) {
- var4.addElement(var7.nextElement());
- if (!var2.testnode((Rexx)var4.elementAt(var3))) {
- var4.removeElementAt(var3);
- } else {
- ++var3;
- }
- }
- } catch (Throwable var9) {
- throw var9;
- }
-
- while(true) {
- --var3;
- if (var3 < 0) {
- return this.Err(0, true);
- }
-
- Rexx var10 = (Rexx)var4.elementAt(var3);
- this.stemCursor.getnode(var10).leaf = this.stemCursor;
- }
- }
-
- public RXFile() {
- Object var1 = null;
- this.iLastErr = -1;
- this.fdFileDescriptor = new FileDescriptor();
- this.fisFileInputStream = new FileInputStream(FileDescriptor.in);
- this.fosFileOutputStream = new FileOutputStream(FileDescriptor.out);
- this.disConsoleIn = new DataInputStream(this.fisFileInputStream);
- this.dosConsoleOut = new DataOutputStream(this.fosFileOutputStream);
- Rexx var2 = new Rexx(System.getProperty("line.separator"));
- if (var2.OpEq((RexxSet)null, new Rexx(String.valueOf(this.cNLr) + this.cNLn))) {
- this.setparms(false, 1);
- } else if (var2.OpEq((RexxSet)null, new Rexx(this.cNLn))) {
- this.setparms(false, 0);
- } else {
- this.setparms(false, 2);
- }
-
- this.stemCursor = null;
- this.stemCursor = new Rexx("Error: no such cursor.");
- }
-
- public RXFile(Rexx var1) {
- Object var2 = null;
- this.iLastErr = -1;
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- this.fdFileDescriptor = new FileDescriptor();
- this.fisFileInputStream = new FileInputStream(FileDescriptor.in);
- this.fosFileOutputStream = new FileOutputStream(FileDescriptor.out);
- this.disConsoleIn = new DataInputStream(this.fisFileInputStream);
- this.dosConsoleOut = new DataOutputStream(this.fosFileOutputStream);
- Rexx var3 = new Rexx(System.getProperty("line.separator"));
- if (var3.OpEq((RexxSet)null, new Rexx(String.valueOf(this.cNLr) + this.cNLn))) {
- this.setparms(false, 1);
- } else if (var3.OpEq((RexxSet)null, new Rexx(this.cNLn))) {
- this.setparms(false, 0);
- } else {
- this.setparms(false, 2);
- }
-
- this.stemCursor = null;
- this.stemCursor = new Rexx("Error: no such cursor.");
- }
-
- public RXFile(InputStream var1, OutputStream var2) {
- Object var3 = null;
- this.iLastErr = -1;
- this.disConsoleIn = new DataInputStream(var1);
- this.dosConsoleOut = new DataOutputStream(var2);
- Rexx var4 = new Rexx(System.getProperty("line.separator"));
- if (var4.OpEq((RexxSet)null, new Rexx(String.valueOf(this.cNLr) + this.cNLn))) {
- this.setparms(false, 1);
- } else if (var4.OpEq((RexxSet)null, new Rexx(this.cNLn))) {
- this.setparms(false, 0);
- } else {
- this.setparms(false, 2);
- }
-
- this.stemCursor = null;
- this.stemCursor = new Rexx("Error: no such cursor.");
- }
-
- public RXFile(Rexx var1, Rexx var2, Rexx var3) {
- Object var4 = null;
- this.iLastErr = -1;
- this.fdFileDescriptor = new FileDescriptor();
- this.fisFileInputStream = new FileInputStream(FileDescriptor.in);
- this.fosFileOutputStream = new FileOutputStream(FileDescriptor.out);
- this.disConsoleIn = new DataInputStream(this.fisFileInputStream);
- this.dosConsoleOut = new DataOutputStream(this.fosFileOutputStream);
- Rexx var5 = new Rexx(System.getProperty("line.separator"));
- if (var5.OpEq((RexxSet)null, new Rexx(String.valueOf(this.cNLr) + this.cNLn))) {
- this.setparms(false, 1);
- } else if (var5.OpEq((RexxSet)null, new Rexx(this.cNLn))) {
- this.setparms(false, 0);
- } else {
- this.setparms(false, 2);
- }
-
- this.stemCursor = null;
- this.stemCursor = new Rexx("Error: no such cursor.");
- this.stream(var1, var2, var3);
- }
-
- public Rexx attachtoinputstream(InputStream var1) {
- this.disConsoleIn = new DataInputStream(var1);
- return this.Err(0, true);
- }
-
- public Rexx attachtooutputstream(OutputStream var1) {
- this.dosConsoleOut = new DataOutputStream(var1);
- return this.Err(0, true);
- }
-
- private Rexx Err(int var1, boolean var2) {
- if (var1 != -2) {
- this.iLastErr = var1;
- }
-
- if (var2) {
- if (this.iLastErr == -1) {
- return new Rexx("NOFILEOPEN:");
- } else if (this.iLastErr == 0) {
- return new Rexx(this.rReady);
- } else if (this.iLastErr == 1) {
- return new Rexx("SYNTAX ERROR:");
- } else if (this.iLastErr == 2) {
- return new Rexx("NOTREADY:32");
- } else if (this.iLastErr == 3) {
- return new Rexx("NOTREADY:110");
- } else if (this.iLastErr == 4) {
- return new Rexx("NOTREADY:EOF");
- } else if (this.iLastErr == 5) {
- return new Rexx("ILLEGAL:WRONG ACCESS MODE");
- } else if (this.iLastErr == 6) {
- return new Rexx("ILLEGAL:ALREADY EXISTS");
- } else if (this.iLastErr == 7) {
- return new Rexx("ILLEGAL:CANT ACCESS TARGET");
- } else if (this.iLastErr == 8) {
- return new Rexx("ILLEGAL:ALREADY INIT");
- } else if (this.iLastErr == 9) {
- return new Rexx("NOTREADY:NOSUCHDIRECTORY");
- } else {
- return this.iLastErr == 10 ? new Rexx("NOTREADY:DIRECTORYISEMPTY") : new Rexx("WEIRD ERROR:");
- }
- } else if (this.iLastErr == -1) {
- return new Rexx("NOFILEOPEN:");
- } else if (this.iLastErr == 0) {
- return new Rexx(this.rReady);
- } else if (this.iLastErr == 1) {
- return new Rexx("SYNTAX ERROR:");
- } else if (this.iLastErr == 2) {
- return new Rexx("NOTREADY:");
- } else if (this.iLastErr == 3) {
- return new Rexx("NOTREADY:");
- } else if (this.iLastErr == 4) {
- return new Rexx("NOTREADY:");
- } else if (this.iLastErr == 5) {
- return new Rexx("ILLEGAL:");
- } else if (this.iLastErr == 6) {
- return new Rexx("ILLEGAL:");
- } else if (this.iLastErr == 7) {
- return new Rexx("ILLEGAL:");
- } else if (this.iLastErr == 8) {
- return new Rexx("ILLEGAL:");
- } else if (this.iLastErr == 9) {
- return new Rexx("NOTREADY:");
- } else {
- return this.iLastErr == 10 ? new Rexx("NOTREADY:") : new Rexx("WEIRD ERROR:");
- }
- }
-
- public Rexx stream(Rexx var1, Rexx var2, Rexx var3) {
- char var4 = '\u0000';
- Object var12 = null;
- byte var5 = 0;
- long var6 = 0L;
- long var8 = 0L;
- long var10 = 0L;
- Object var13 = null;
- boolean var14 = false;
- if (var1 == null | var2 == null | var3 == null) {
- return this.Err(1, true);
- } else {
- var4 = var2.strip().left(new Rexx((byte)1)).upper().tochar();
- if (var4 != 'C') {
- return this.Err(1, true);
- } else {
- var3 = var3.strip().upper();
- if (var3.OpEq((RexxSet)null, $$11)) {
- return this.Err(1, true);
- } else {
- Rexx[] var15 = new Rexx[2];
- RexxParse.parse(var3, $$25, var15);
- Rexx var71 = var15[0];
- var3 = var15[1];
- var71 = var71.left(new Rexx((byte)1));
- if (var71.OpEq((RexxSet)null, new Rexx('O'))) {
- if (var3.OpEq((RexxSet)null, $$11)) {
- var5 = 3;
- } else if (var3.OpEq((RexxSet)null, new Rexx("READ"))) {
- var5 = 1;
- } else {
- if (!var3.OpEq((RexxSet)null, new Rexx("WRITE"))) {
- return this.Err(1, true);
- }
-
- var5 = 2;
- }
- } else if (var71.OpEq((RexxSet)null, new Rexx('Q'))) {
- if (var3.OpEq((RexxSet)null, new Rexx("SIZE"))) {
- var5 = 4;
- } else if (var3.OpEq((RexxSet)null, new Rexx("EXISTS"))) {
- var5 = 5;
- } else {
- if (!var3.OpEq((RexxSet)null, new Rexx("DATETIME"))) {
- return this.Err(1, true);
- }
-
- var5 = 6;
- }
- } else if (var71.OpEq((RexxSet)null, new Rexx('C'))) {
- var5 = 7;
- } else if (var71.OpEq((RexxSet)null, new Rexx('S'))) {
- if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('='))) {
- var5 = 8;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$37)) {
- var5 = 9;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$39)) {
- var5 = 10;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpAdd((RexxSet)null, $$36).tolong();
- } else {
- if (!var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('<'))) {
- return this.Err(1, true);
- }
-
- var5 = 17;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).tolong();
- }
- } else if (var71.OpEq((RexxSet)null, new Rexx('W'))) {
- if (this.lWriteCurs == -1L | (!this.bRWCurs || false)) {
- return this.Err(5, true);
- }
-
- if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('='))) {
- var5 = 11;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$37)) {
- var5 = 12;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$39)) {
- var5 = 13;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpAdd((RexxSet)null, $$36).tolong();
- } else {
- if (!var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('<'))) {
- return this.Err(1, true);
- }
-
- var5 = 18;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).tolong();
- }
- } else {
- if (!var71.OpEq((RexxSet)null, new Rexx('R'))) {
- return this.Err(1, true);
- }
-
- if (this.lReadCurs == -1L | (!this.bRWCurs || false)) {
- return this.Err(5, true);
- }
-
- if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('='))) {
- var5 = 14;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$37)) {
- var5 = 15;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpSub((RexxSet)null, $$36).tolong();
- } else if (var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, $$39)) {
- var5 = 16;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).OpAdd((RexxSet)null, $$36).tolong();
- } else {
- if (!var3.left(new Rexx((byte)1)).OpEq((RexxSet)null, new Rexx('<'))) {
- return this.Err(1, true);
- }
-
- var5 = 19;
- var6 = var3.right(var3.length().OpSub((RexxSet)null, $$36)).tolong();
- }
- }
-
- try {
- var73 = new File(var1.toString());
- var14 = var73.exists();
- var10 = var73.length();
- if ((!var14 || false) & var5 == 5) {
- return new Rexx("");
- }
-
- if ((!var14 || false) & (var5 < 1 | var5 > 3)) {
- return this.Err(3, true);
- }
-
- var1 = new Rexx(var73.getAbsolutePath());
- } catch (NullPointerException var52) {
- if (var5 != 5) {
- return this.Err(1, true);
- }
-
- return new Rexx("");
- }
-
- if (this.rName != null && var1.OpEq((RexxSet)null, this.rName) & var5 > 0 & var5 < 4) {
- if (var5 == 1) {
- if (this.lWriteCurs == -1L) {
- return this.Err(0, true);
- }
- } else if (var5 == 2) {
- if (this.lReadCurs == -1L) {
- return this.Err(0, true);
- }
- } else if (this.lWriteCurs != -1L & this.lReadCurs != -1L) {
- return this.Err(0, true);
- }
- }
-
- if (this.rName != null && var1.OpEq((RexxSet)null, this.rName) & var5 == 7 | (var5 > 0 & var5 < 4 | var5 > 7 & var5 < 20) & var1.OpNotEq((RexxSet)null, this.rName)) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- this.rName = null;
- } catch (IOException var51) {
- return this.Err(100, true);
- }
- }
-
- if (var5 == 1) {
- try {
- this.rafStream = new RandomAccessFile(var73, "r");
- this.lWriteCurs = -1L;
- this.lReadCurs = 1L;
- this.bLastWasRead = true;
- this.rName = var1;
- } catch (IOException var34) {
- return this.Err(2, true);
- }
- } else if (var5 == 2) {
- try {
- this.rafStream = new RandomAccessFile(var73, "rw");
- this.lWriteCurs = 1L;
- this.lReadCurs = -1L;
- this.bLastWasRead = false;
- this.rName = var1;
- } catch (IOException var33) {
- return this.Err(2, true);
- }
- } else {
- if (var5 != 3) {
- if (var5 == 4) {
- return new Rexx(var73.length());
- }
-
- if (var5 == 5) {
- return var1;
- }
-
- if (var5 == 6) {
- return new Rexx(var73.lastModified());
- }
-
- if (var5 == 8) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- if (this.lWriteCurs > -1L) {
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- }
-
- if (this.lReadCurs != -1L) {
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- }
-
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var35) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var31) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 9) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- if (this.lReadCurs != -1L) {
- try {
- var6 += this.lReadCurs;
- if (var10 < var6) {
- var6 = var10;
- }
-
- this.rafStream.seek(var6);
- this.bLastWasRead = true;
- } catch (IOException var37) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var30) {
- return this.Err(2, true);
- }
- }
- } else {
- try {
- var6 += this.lWriteCurs;
- if (var10 < var6) {
- var6 = var10;
- }
-
- this.rafStream.seek(var6);
- this.bLastWasRead = false;
- } catch (IOException var36) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var29) {
- return this.Err(2, true);
- }
- }
- }
-
- if (this.lWriteCurs > -1L) {
- this.lWriteCurs = var6 + 1L;
- }
-
- if (this.lReadCurs != -1L) {
- this.lReadCurs = var6 + 1L;
- }
-
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var38) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var28) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 10) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- if (this.lReadCurs != -1L) {
- try {
- var6 = this.lReadCurs - var6;
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.bLastWasRead = true;
- } catch (IOException var40) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var27) {
- return this.Err(2, true);
- }
- }
- } else {
- try {
- var6 = this.lWriteCurs - var6;
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.bLastWasRead = false;
- } catch (IOException var39) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var26) {
- return this.Err(2, true);
- }
- }
- }
-
- if (this.lWriteCurs > -1L) {
- this.lWriteCurs = var6 + 1L;
- }
-
- if (this.lReadCurs != -1L) {
- this.lReadCurs = var6 + 1L;
- }
-
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var41) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var25) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 11) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var42) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var24) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 12) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var6 += this.lWriteCurs;
- if (var10 < var6) {
- var6 = var10;
- }
-
- this.rafStream.seek(var6);
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var43) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var23) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 13) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var6 = this.lWriteCurs - var6;
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var44) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var22) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 14) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var45) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var21) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 15) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var6 += this.lReadCurs;
- if (var10 < var6) {
- var6 = var10;
- }
-
- this.rafStream.seek(var6);
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var46) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var20) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 16) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var6 = this.lReadCurs - var6;
- if (var10 < var6) {
- var6 = var10;
- }
-
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var47) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var19) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 17) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var8 = this.rafStream.length();
- var6 = var8 - var6;
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- if (this.lWriteCurs > -1L) {
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- }
-
- if (this.lReadCurs != -1L) {
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- }
-
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var48) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var18) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 18) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var8 = this.rafStream.length();
- var6 = var8 - var6;
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lReadCurs = var6 + 1L;
- this.bLastWasRead = true;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var49) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var17) {
- return this.Err(2, true);
- }
- }
- }
-
- if (var5 == 19) {
- try {
- if (this.rafStream == null) {
- this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- }
-
- var8 = this.rafStream.length();
- var6 = var8 - var6;
- if (var6 < 0L) {
- var6 = 0L;
- }
-
- this.rafStream.seek(var6);
- this.lWriteCurs = var6 + 1L;
- this.bLastWasRead = false;
- return new Rexx(this.rafStream.getFilePointer() + 1L);
- } catch (IOException var50) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(100, true);
- } catch (IOException var16) {
- return this.Err(2, true);
- }
- }
- }
-
- return this.Err(0, true);
- }
-
- try {
- this.rafStream = new RandomAccessFile(var73, "rw");
- if (this.bRWCurs) {
- this.lWriteCurs = 1L;
- } else {
- this.lWriteCurs = -2L;
- }
-
- this.lReadCurs = 1L;
- this.bLastWasRead = true;
- this.rName = var1;
- } catch (IOException var32) {
- return this.Err(2, true);
- }
- }
-
- return this.Err(0, true);
- }
- }
- }
- }
-
- public Rexx stream(Rexx var1, Rexx var2) {
- return this.rafStream == null ? this.Err(-1, true) : this.stream(this.rName, var1, var2);
- }
-
- public Rexx stream(Rexx var1) {
- if (this.rafStream == null) {
- return this.Err(-1, true);
- } else {
- var1 = var1.strip().left(new Rexx((byte)1)).upper();
- if (var1.OpEq((RexxSet)null, new Rexx('D'))) {
- return this.Err(-2, true);
- } else {
- return var1.OpEq((RexxSet)null, new Rexx('S')) ? this.Err(-2, false) : this.Err(1, true);
- }
- }
- }
-
- public Rexx delete(Rexx var1) {
- Object var2 = null;
-
- try {
- var4 = new File(var1.toString());
- } catch (NullPointerException var3) {
- return this.Err(1, true);
- }
-
- return var4.delete() ? this.Err(0, true) : this.Err(3, true);
- }
-
- public Rexx rename(Rexx var1, Rexx var2) {
- Object var3 = null;
- Object var4 = null;
-
- try {
- var6 = new File(var1.toString());
- var7 = new File(var2.toString());
- } catch (NullPointerException var5) {
- return this.Err(1, true);
- }
-
- if (var6.exists() && true) {
- if (var7.exists()) {
- return this.Err(3, true);
- } else {
- return var6.renameTo(var7) ? this.Err(0, true) : this.Err(7, true);
- }
- } else {
- return this.Err(6, true);
- }
- }
-
- public Rexx mkdir(Rexx var1) {
- Object var2 = null;
-
- try {
- var4 = new File(var1.toString());
- } catch (NullPointerException var3) {
- return this.Err(1, true);
- }
-
- return var4.mkdir() ? this.Err(0, true) : this.Err(7, true);
- }
-
- public Rexx mkdirs(Rexx var1) {
- Object var2 = null;
-
- try {
- var4 = new File(var1.toString());
- } catch (NullPointerException var3) {
- return this.Err(1, true);
- }
-
- return var4.mkdirs() ? this.Err(0, true) : this.Err(7, true);
- }
-
- public Rexx[] StringArrayToRexxArray(String[] var1) {
- int var2 = 0;
- Rexx[] var3 = new Rexx[1];
- boolean var4 = false;
- var3[0] = this.Err(9, true);
- if (var1 == null) {
- return var3;
- } else {
- try {
- if ((new Rexx(var1[0])).OpEq((RexxSet)null, $$11)) {
- return var3;
- }
- } catch (ArrayIndexOutOfBoundsException var7) {
- var3[0] = this.Err(10, true);
- return var3;
- }
-
- try {
- boolean var5 = true;
-
- while(true) {
- if (var5) {
- var5 = false;
- } else if (var1[var2] == null | var4) {
- break;
- }
-
- ++var2;
- }
- } catch (ArrayIndexOutOfBoundsException var6) {
- var4 = true;
- }
-
- return this.sArrayTor(var1, var2);
- }
- }
-
- private Rexx[] sArrayTor(String[] var1, int var2) {
- boolean var3 = false;
- Rexx[] var4 = new Rexx[var2];
- if (var2 == 1) {
- var4[0] = new Rexx(var1[0]);
- } else {
- int var5 = var2 - 1;
-
- for(int var6 = 0; var6 <= var5; ++var6) {
- var4[var6] = new Rexx(var1[var6]);
- }
- }
-
- return var4;
- }
-
- public Rexx properties(Rexx var1) {
- Object var2 = null;
- Object var3 = null;
-
- try {
- File var5 = new File(var1.toString());
- Rexx var6;
- if (var5.isFile()) {
- var6 = new Rexx('f');
- } else {
- var6 = new Rexx('-');
- }
-
- if (var5.isDirectory()) {
- var6 = var6.OpCc((RexxSet)null, new Rexx('d'));
- } else {
- var6 = var6.OpCc((RexxSet)null, $$39);
- }
-
- if (var5.canRead()) {
- var6 = var6.OpCc((RexxSet)null, new Rexx('r'));
- } else {
- var6 = var6.OpCc((RexxSet)null, $$39);
- }
-
- if (var5.canWrite()) {
- var6 = var6.OpCc((RexxSet)null, new Rexx('w'));
- } else {
- var6 = var6.OpCc((RexxSet)null, $$39);
- }
-
- return var6;
- } catch (NullPointerException var4) {
- return this.Err(3, true);
- }
- }
-
- private Rexx synch(boolean var1) {
- if (this.bRWCurs && true) {
- if (var1) {
- if (!this.bLastWasRead || false) {
- try {
- if (this.lReadCurs == -1L) {
- return this.Err(5, true);
- }
-
- this.rafStream.seek(this.lReadCurs);
- } catch (IOException var5) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var3) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
- } else if (this.bLastWasRead) {
- try {
- if (this.lWriteCurs == -1L) {
- return this.Err(5, true);
- }
-
- this.rafStream.seek(this.lWriteCurs);
- } catch (IOException var4) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var2) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
-
- return this.Err(0, true);
- } else {
- return this.Err(0, true);
- }
- }
-
- public Rexx chars(Rexx var1) {
- Object var2 = null;
- Rexx var3 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var3.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var3 : this.chars();
- }
-
- public Rexx chars() {
- int var2 = 0;
- Object var1 = null;
- if (this.rafStream != null) {
- if (this.lReadCurs != -1L) {
- try {
- if (this.lWriteCurs > -1L) {
- Rexx var6 = this.synch(true);
- if (var6.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var6;
- }
-
- this.bLastWasRead = true;
- }
-
- return new Rexx(this.rafStream.length() - this.lReadCurs + 1L);
- } catch (IOException var4) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var3) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- } else {
- return this.Err(7, true);
- }
- } else {
- try {
- var2 = this.disConsoleIn.available();
- return new Rexx(var2);
- } catch (IOException var5) {
- return new Rexx((byte)0);
- }
- }
- }
-
- public Rexx lines(Rexx var1) {
- Object var2 = null;
- Rexx var3 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var3.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var3 : this.lines();
- }
-
- public Rexx lines() {
- Object var1 = null;
- Rexx var2 = this.chars();
- if (var2.datatype(new Rexx("Number")).OpEq((RexxSet)null, $$36)) {
- return var2.OpNotEq((RexxSet)null, $$179) ? new Rexx((byte)1) : new Rexx((byte)0);
- } else {
- return var2;
- }
- }
-
- public Rexx charin(Rexx var1) {
- int var4 = 0;
- Object var2 = null;
- Object var3 = null;
- Rexx var7 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- if (var7.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var7;
- } else {
- try {
- if (this.lReadCurs == -1L) {
- return this.Err(7, true);
- } else {
- if (this.lWriteCurs > -1L) {
- Rexx var8 = this.synch(true);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- }
-
- var4 = this.rafStream.read();
- if (var4 == -1) {
- this.Err(4, true);
- return this.Err(4, true);
- } else {
- ++this.lReadCurs;
- this.bLastWasRead = true;
- return new Rexx((char)var4);
- }
- }
- } catch (IOException var6) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var5) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
- }
-
- public Rexx charin() {
- int var2 = 0;
- Object var1 = null;
- if (this.rafStream == null) {
- try {
- return new Rexx((char)this.disConsoleIn.readByte());
- } catch (IOException var4) {
- return this.Err(2, true);
- }
- } else {
- try {
- if (this.lReadCurs == -1L) {
- return this.Err(7, true);
- } else {
- if (this.lWriteCurs > -1L) {
- Rexx var6 = this.synch(true);
- if (var6.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var6;
- }
- }
-
- var2 = this.rafStream.read();
- if (var2 == -1) {
- this.Err(4, true);
- return this.Err(4, true);
- } else {
- ++this.lReadCurs;
- this.bLastWasRead = true;
- return new Rexx((char)var2);
- }
- }
- } catch (IOException var5) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var3) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
- }
-
- public Rexx charin(Rexx var1, long var2, int var4) {
- Object var5 = null;
- Object var6 = null;
- byte[] var7 = new byte[var4];
- Rexx var10 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- if (var10.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var10;
- } else if (this.lReadCurs == -1L) {
- return this.Err(7, true);
- } else if (var2 < 0L | var4 < 0) {
- return this.Err(1, true);
- } else {
- if (var2 != 0L) {
- if (this.lWriteCurs > -1L) {
- Rexx var11 = this.synch(true);
- if (var11.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var11;
- }
- } else if (this.bRWCurs) {
- Rexx var12 = this.stream(new Rexx(this.rCommand), new Rexx("rseek =" + String.valueOf(var2)));
- if (var12.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var12;
- }
- } else {
- Rexx var13 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAt + String.valueOf(var2)));
- if (var13.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var13;
- }
- }
- }
-
- new Rexx("");
-
- try {
- this.rafStream.read(var7, 0, var4);
- Rexx var14 = new Rexx(new String(var7, 0));
- this.lReadCurs = (new Rexx(this.lReadCurs)).OpAdd((RexxSet)null, var14.length()).tolong();
- this.bLastWasRead = true;
- return var14;
- } catch (IOException var9) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var8) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
- }
-
- public Rexx charin(long var1, int var3) {
- Object var4 = null;
- byte[] var5 = new byte[var3];
- if (this.rafStream == null) {
- return this.Err(-1, true);
- } else if (this.lReadCurs == -1L) {
- return this.Err(7, true);
- } else if (var1 < 0L | var3 < 0) {
- return this.Err(1, true);
- } else {
- if (var1 != 0L) {
- if (this.lWriteCurs > -1L) {
- Rexx var8 = this.synch(true);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- } else if (this.bRWCurs) {
- Rexx var9 = this.stream(new Rexx(this.rCommand), new Rexx("rseek =" + String.valueOf(var1)));
- if (var9.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var9;
- }
- } else {
- Rexx var10 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAt + String.valueOf(var1)));
- if (var10.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var10;
- }
- }
- }
-
- try {
- this.rafStream.read(var5, 0, var3);
- Rexx var11 = new Rexx(new String(var5, 0));
- this.lReadCurs = (new Rexx(this.lReadCurs)).OpAdd((RexxSet)null, var11.length()).tolong();
- this.bLastWasRead = true;
- return var11;
- } catch (IOException var7) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var6) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- }
- }
-
- public Rexx linein(Rexx var1, int var2, int var3) {
- Object var4 = null;
- Object var5 = null;
- int var6 = 0;
- long var7 = 0L;
- Rexx var12 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- if (var12.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var12;
- } else if (var2 != 0 & var2 != 1 | var3 != 0 & var3 != 1) {
- return this.Err(1, true);
- } else if (this.rafStream == null) {
- return this.Err(-1, true);
- } else {
- if (var2 == 0) {
- Rexx var15;
- if (this.bRWCurs && true) {
- var15 = this.stream(new Rexx(this.rCommand), new Rexx(this.rRSeekAtZero));
- } else {
- var15 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAtZero));
- }
-
- if (var15.datatype(new Rexx(this.rNumeric)).OpEq((RexxSet)null, $$179)) {
- return var15;
- }
- }
-
- if (var3 == 0) {
- return new Rexx("");
- } else if (this.rafStream == null) {
- try {
- return new Rexx(this.disConsoleIn.readLine());
- } catch (IOException var10) {
- return this.Err(2, true);
- }
- } else if (this.lReadCurs != -1L) {
- try {
- if (this.lWriteCurs > -1L) {
- var12 = this.synch(true);
- if (var12.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var12;
- }
- }
-
- var12 = new Rexx(this.rafStream.readLine());
- var6 = var12.length().toint();
- this.lReadCurs = this.lReadCurs + (long)var6 + 1L;
- var7 = this.rafStream.length();
- if (this.lReadCurs > var7 + 1L) {
- this.lReadCurs = var7 + 1L;
- }
-
- this.bLastWasRead = true;
- if (var6 == 0) {
- return new Rexx("");
- } else {
- return var12.right(new Rexx((byte)1)).c2d().OpEq((RexxSet)null, $$219) ? var12.left(new Rexx(var6 - 1)) : var12;
- }
- } catch (IOException var11) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var9) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- } else {
- return this.Err(7, true);
- }
- }
- }
-
- public Rexx linein(int var1, int var2) {
- Object var3 = null;
- Object var4 = null;
- int var5 = 0;
- long var6 = 0L;
- if (var1 != 0 & var1 != 1 | var2 != 0 & var2 != 1) {
- return this.Err(1, true);
- } else if (this.rafStream == null) {
- return this.Err(-1, true);
- } else {
- if (var1 == 0) {
- Rexx var11;
- if (this.bRWCurs && true) {
- var11 = this.stream(new Rexx(this.rCommand), new Rexx(this.rRSeekAtZero));
- } else {
- var11 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAtZero));
- }
-
- if (var11.datatype(new Rexx(this.rNumeric)).OpEq((RexxSet)null, $$179)) {
- return var11;
- }
- }
-
- if (var2 == 0) {
- return new Rexx("");
- } else if (this.rafStream == null) {
- try {
- return new Rexx(this.disConsoleIn.readLine());
- } catch (IOException var9) {
- return this.Err(2, true);
- }
- } else if (this.lReadCurs != -1L) {
- try {
- if (this.lWriteCurs > -1L) {
- Rexx var12 = this.synch(true);
- if (var12.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var12;
- }
- }
-
- Rexx var13 = new Rexx(this.rafStream.readLine());
- var5 = var13.length().toint();
- this.lReadCurs = this.lReadCurs + (long)var5 + 1L;
- var6 = this.rafStream.length();
- if (this.lReadCurs > var6 + 1L) {
- this.lReadCurs = var6 + 1L;
- }
-
- this.bLastWasRead = true;
- if (var5 == 0) {
- return new Rexx("");
- } else {
- return var13.right(new Rexx((byte)1)).c2d().OpEq((RexxSet)null, $$219) ? var13.left(new Rexx(var5 - 1)) : var13;
- }
- } catch (IOException var10) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var8) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- } else {
- return this.Err(7, true);
- }
- }
- }
-
- public Rexx linein() {
- Object var1 = null;
- int var2 = 0;
- long var3 = 0L;
- if (this.rafStream == null) {
- try {
- return new Rexx(this.disConsoleIn.readLine());
- } catch (IOException var6) {
- return this.Err(2, true);
- }
- } else if (this.lReadCurs != -1L) {
- try {
- if (this.lWriteCurs > -1L) {
- Rexx var8 = this.synch(true);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- }
-
- Rexx var9 = new Rexx(this.rafStream.readLine());
- var2 = var9.length().toint();
- this.lReadCurs = this.lReadCurs + (long)var2 + 1L;
- var3 = this.rafStream.length();
- if (this.lReadCurs > var3 + 1L) {
- this.lReadCurs = var3 + 1L;
- }
-
- this.bLastWasRead = true;
- if (var2 == 0) {
- return new Rexx("");
- } else {
- return var9.right(new Rexx((byte)1)).c2d().OpEq((RexxSet)null, $$219) ? var9.left(new Rexx(var2 - 1)) : var9;
- }
- } catch (IOException var7) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var5) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- } else {
- return this.Err(7, true);
- }
- }
-
- public Rexx linein(Rexx var1) {
- Object var2 = null;
- int var3 = 0;
- long var4 = 0L;
- Rexx var8 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- } else if (this.lReadCurs != -1L) {
- try {
- if (this.lWriteCurs > -1L) {
- var8 = this.synch(true);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- }
-
- var8 = new Rexx(this.rafStream.readLine());
- var3 = var8.length().toint();
- this.lReadCurs = this.lReadCurs + (long)var3 + 1L;
- var4 = this.rafStream.length();
- if (this.lReadCurs > var4 + 1L) {
- this.lReadCurs = var4 + 1L;
- }
-
- this.bLastWasRead = true;
- if (var3 == 0) {
- return new Rexx("");
- } else {
- return var8.right(new Rexx((byte)1)).c2d().OpEq((RexxSet)null, $$219) ? var8.left(new Rexx(var3 - 1)) : var8;
- }
- } catch (IOException var7) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var6) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
- } else {
- return this.Err(7, true);
- }
- }
-
- public Rexx charout(Rexx var1, long var2) {
- Object var4 = null;
- Object var5 = null;
- if (this.rafStream == null) {
- return this.Err(-1, true);
- } else if (this.lWriteCurs == -1L) {
- return this.Err(7, true);
- } else if (var2 < 0L) {
- return this.Err(1, true);
- } else {
- if (var1 == null) {
- var1 = new Rexx("");
- }
-
- if (this.lReadCurs != -1L) {
- Rexx var9 = this.synch(false);
- if (var9.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var9;
- }
- }
-
- String var8 = var1.toString();
- if (var2 != 0L) {
- Rexx var10;
- if (this.bRWCurs) {
- var10 = this.stream(new Rexx(this.rCommand), new Rexx(this.rWSeekAt + String.valueOf(var2)));
- if (var10.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var10;
- }
- } else {
- var10 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAt + String.valueOf(var2)));
- }
-
- if (var10.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var10;
- }
- }
-
- try {
- this.rafStream.writeBytes(var8);
- if (this.bRWCurs) {
- this.lWriteCurs += (long)var8.length();
- } else if (this.lWriteCurs == -2L) {
- this.lReadCurs += (long)var8.length();
- } else {
- this.lWriteCurs += (long)var8.length();
- }
-
- this.bLastWasRead = false;
- } catch (IOException var7) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var6) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
-
- return this.Err(0, true);
- }
- }
-
- public Rexx charout(Rexx var1) {
- Object var2 = null;
- Object var3 = null;
- if (var1 == null) {
- return this.Err(0, true);
- } else if (this.rafStream == null) {
- try {
- this.dosConsoleOut.writeBytes(var1.toString());
- this.dosConsoleOut.flush();
- return this.Err(0, true);
- } catch (IOException var5) {
- return this.Err(7, true);
- }
- } else if (this.rafStream == null) {
- return this.Err(-1, true);
- } else if (this.lWriteCurs == -1L) {
- return this.Err(7, true);
- } else {
- if (var1 == null) {
- var1 = new Rexx("");
- }
-
- if (this.lReadCurs != -1L) {
- Rexx var8 = this.synch(false);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- }
-
- String var7 = var1.toString();
-
- try {
- this.rafStream.writeBytes(var7);
- if (this.bRWCurs) {
- this.lWriteCurs += (long)var7.length();
- } else if (this.lWriteCurs == -2L) {
- this.lReadCurs += (long)var7.length();
- } else {
- this.lWriteCurs += (long)var7.length();
- }
-
- this.bLastWasRead = false;
- } catch (IOException var6) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var4) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
-
- return this.Err(0, true);
- }
- }
-
- public Rexx charout(Rexx var1, Rexx var2) {
- Object var3 = null;
- Rexx var4 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var4.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var4 : this.charout(var2);
- }
-
- public Rexx charout(Rexx var1, Rexx var2, long var3) {
- Object var5 = null;
- Rexx var6 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var6.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var6 : this.charout(var2, var3);
- }
-
- public Rexx lineout(Rexx var1) {
- Object var2 = null;
- Object var3 = null;
- if (this.rafStream == null) {
- try {
- this.dosConsoleOut.writeBytes(var1.OpCc((RexxSet)null, this.rNLine).toString());
- this.dosConsoleOut.flush();
- return this.Err(0, true);
- } catch (IOException var5) {
- return this.Err(7, true);
- }
- } else if (this.lWriteCurs == -1L) {
- return this.Err(7, true);
- } else {
- if (var1 == null) {
- var1 = new Rexx("");
- }
-
- if (this.lReadCurs != -1L) {
- Rexx var8 = this.synch(false);
- if (var8.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var8;
- }
- }
-
- String var7 = var1.OpCc((RexxSet)null, this.rNLine).toString();
-
- try {
- this.rafStream.writeBytes(var7);
- if (this.bRWCurs) {
- this.lWriteCurs += (long)var7.length();
- } else if (this.lWriteCurs == -2L) {
- this.lReadCurs += (long)var7.length();
- } else {
- this.lWriteCurs += (long)var7.length();
- }
-
- this.bLastWasRead = false;
- } catch (IOException var6) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var4) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
-
- return this.Err(0, true);
- }
- }
-
- public Rexx lineout(Rexx var1, long var2) {
- Object var4 = null;
- Object var5 = null;
- if (this.rafStream == null) {
- return this.Err(-1, true);
- } else if (this.lWriteCurs == -1L) {
- return this.Err(7, true);
- } else if (var2 < 0L) {
- return this.Err(1, true);
- } else {
- if (var1 == null) {
- var1 = new Rexx("");
- }
-
- var1 = var1.OpCc((RexxSet)null, this.rNLine);
- if (this.lReadCurs != -1L) {
- Rexx var10 = this.synch(false);
- if (var10.OpNotEq((RexxSet)null, new Rexx(this.rReady))) {
- return var10;
- }
- }
-
- String var9 = var1.toString();
- if (var2 != 0L) {
- Rexx var11;
- if (this.bRWCurs) {
- var11 = this.stream(new Rexx(this.rCommand), new Rexx(this.rWSeekAt + String.valueOf(var2)));
- if (var11.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var11;
- }
- } else {
- var11 = this.stream(new Rexx(this.rCommand), new Rexx(this.rSeekAt + String.valueOf(var2)));
- }
-
- if (var11.datatype(new Rexx(this.rNumeric)).OpNotEq((RexxSet)null, $$36)) {
- return var11;
- }
- }
-
- try {
- this.rafStream.writeBytes(var9);
- if (this.bRWCurs) {
- this.lWriteCurs += (long)var9.length();
- } else if (this.lWriteCurs == -2L) {
- this.lReadCurs += (long)var9.length();
- } else {
- this.lWriteCurs += (long)var9.length();
- }
-
- this.bLastWasRead = false;
- } catch (IOException var7) {
- try {
- this.rafStream.close();
- this.rafStream = null;
- return this.Err(2, true);
- } catch (IOException var6) {
- this.rafStream = null;
- return this.Err(2, true);
- }
- }
-
- return this.Err(0, true);
- }
- }
-
- public Rexx lineout(Rexx var1, Rexx var2, long var3) {
- Object var5 = null;
- Rexx var6 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var6.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var6 : this.lineout(var2, var3);
- }
-
- public Rexx lineout(Rexx var1, Rexx var2) {
- Object var3 = null;
- Rexx var4 = this.stream(var1, new Rexx(this.rCommand), new Rexx(this.rOpen));
- return var4.OpNotEq((RexxSet)null, new Rexx(this.rReady)) ? var4 : this.lineout(var2);
- }
- }
-