Permalink
Browse files

turn a 2K memory dump data file into two 1024 byte tracks for the dis…

…k drive. rename them as necessary
  • Loading branch information...
1 parent 1b56a4f commit 93a863b2cc64a2e560e8f761a3356b3510857b30 @ladyada ladyada committed Oct 18, 2010
Showing with 24 additions and 0 deletions.
  1. +24 −0 splitfile2track.py
View
@@ -0,0 +1,24 @@
+import sys
+
+
+if len(sys.argv) != 2:
+ print 'Usage: %s file.dat' % sys.argv[0]
+ print 'Splits a 2K file.dat file into two 1K track files track0.dat and track1.dat'
+ sys.exit()
+
+
+
+infile = open(sys.argv[1], 'r')
+
+track0file = open("track0.dat", 'w')
+track1file = open("track1.dat", 'w')
+
+t0dat = infile.read(1024)
+t1dat = infile.read(1024)
+
+
+track0file.write(t0dat)
+track0file.close()
+
+track1file.write(t1dat)
+track1file.close()

0 comments on commit 93a863b

Please sign in to comment.