P_tmpdir
f = P_tmpdir;
tmpdir = P_tmpdir;
snprintf(nameBuffer, L_tmpnam, "%stmp.%d.XXXXXX", P_tmpdir, (int)atomic_add(&counter, 1));