Name: Anonymous 2006-07-30 21:33
HAY GUYS its me again, i've brought you play asx streams in python, now i give you... linux... cd burning... simplification
usage: ./cdcheckwrite.py [files]
replace with own vars, but seriously if you know how you could've written this yourself. so this is really only good for people that have the exact same setup as i do.
usage: ./cdcheckwrite.py [files]
#!/usr/bin/env python
import os, sys
files = sys.argv[1:]
MAX_CD_SIZE = 740000000 #max size in bytes
total_size = 0
for i in files:
total_size += int(os.path.getsize(i))
if total_size > MAX_CD_SIZE:
print
print "ERROR: File list of %s bytes, exceedes max size of %s bytes!" \
%(total_size, MAX_CD_SIZE)
print "Consider Splitting up the files"
print
sys.exit()
else:
print
print "Burning files:"
for i in files:
print i
print
stomped_filelist = '"'+'" "'.join(files)+'"'
print stomped_filelist
os.system('mkisofs -r -J -l -v -o tmpiso.iso ' + stomped_filelist )
os.system("cdrecord dev=/dev/cdrom speed=52 gracetime=2 -eject -v tmpiso.iso")
print
print "Success!"
print
os.remove("tmpiso.iso")
replace with own vars, but seriously if you know how you could've written this yourself. so this is really only good for people that have the exact same setup as i do.