Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 93a863b2cc64a2e560e8f761a3356b3510857b30 1 parent 1b56a4f
@ladyada ladyada authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 splitfile2track.py
View
24 splitfile2track.py
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.