Any reason you aren't doing this in Ruby? Only hurts platform compat and requires file I/O for no obvious reason.