Mouse-Imaging-Centre/RMINC — pull request #32 by yohanyee (2014-10-30 01:48:32+00:00)
Title: Fix anatGetFile to write to /tmp directory rather than common /tmp file in home directory

This avoids clashes between concurrent instances of anatGetFile calls.

Each time anatGetFile writes to a temporary file, a unique identifier (uid) is created and "RMINC-[uid].txt" is written to in /tmp. The uids are generated randomly using sample(). Assuming perfect random sampling on 10000 anatGetFile calls and subsequent uid generations, there is approximately a 9e-07 chance of a uid collision, which (according to Wikipedia) is slightly greater than the death-by-lightning rate per person per year in Germany.