Exemple #1
0
 static void Main(string[] args)
 {
     if (args.Length != 2)
     {
         Console.Error.WriteLine("Usage: Tp2p7b input.tap output.tap");
         return;
     }
     using (TapeReader r = new TapeReader(args[0], false))
         using (TapeWriter w = new TapeWriter(args[1], true))
         {
             int ret;
             while ((ret = r.ReadRecord(out bool binary, out byte[] mrecord)) >= 0)
             {
                 if (ret == 0)
                 {
                     Console.WriteLine("Eof");
                 }
                 else
                 {
                     Console.WriteLine("{0} record, length {1}", binary ? "binary" : "BCD", mrecord.Length);
                 }
                 if (ret == 0)
                 {
                     w.WriteEOF();
                 }
                 else
                 {
                     w.WriteRecord(binary, mrecord);
                 }
             }
         }
     return;
 }
Exemple #2
0
 static void Main(string[] args)
 {
     if (args.Length != 2)
     {
         Console.Error.WriteLine("Usage: WriteTape input.txt output.tap");
         return;
     }
     using (StreamReader r = new StreamReader(args[0]))
         using (TapeWriter w = new TapeWriter(args[1], true))
         {
             while (!r.EndOfStream)
             {
                 string line = ExpandTabs(r.ReadLine().ToUpper(), 8).PadRight(80).Substring(0, 80).PadRight(84);
                 w.WriteRecord(false, BcdConverter.StringToBcd(line));
             }
             w.WriteEOF();
         }
 }