tmp dir must be read-write.