#!/usr/bin/env python

""" Usage: burn-pkm <pathSpec>

	Burn the given files and directories to the CD-R. You don't need to remember
	all the different switches to make the ISO file and to send to cdrecord.
	
	You need to be a member of sudoer's. See 'man sudo' for information on 
	setting that up.
	
	Requires the mkisofs and cdrecord utilities, which likely already exist on 
	your Linux system.
	
	Enjoy!   --Paul McNett (p@ulmcnett.com)
"""
import sys, os

def main():
	pathSpec = sys.argv[1:]
	
	if len(pathSpec) == 0:
		sys.stderr.write(__doc__)
		sys.exit()

	tempFileName = "temp-pkm.iso"

	files = ""
	for file in pathSpec:
		files = ' '.join((files, file))
	
	os.system("mkisofs-pkm -o %s %s" % (tempFileName, files))
	os.system("cdrecord-pkm %s" % (tempFileName,))
	os.system("rm -f %s" % tempFileName)

if __name__ == "__main__":
	main()
