chrislusf / gleam

Fast, efficient, and scalable distributed map/reduce system, DAG execution, in memory or on disk, written in pure Go, runs standalone or distributedly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible risk of temporary file collision

JensRantil opened this issue · comments

I'm reading

filename := fmt.Sprintf("%s/s3_%d", os.TempDir(), rand.Uint32())
and
filename := fmt.Sprintf("%s/gs_%d", os.TempDir(), rand.Uint32())
and both has a slight risk of file name collisions. I propose migrating to use https://golang.org/pkg/io/ioutil/#TempFile which makes that scenario impossible.

Send a PR?