testMain has sample code for writing to a possibly new directory