Use exec instead of system
Add File.write to ctfutils