witty-crayon-22786
03/27/2017, 7:00 PMwitty-crayon-22786
03/27/2017, 7:01 PMlet mut tg = self.temp_generator.lock().unwrap();
tg.1 = tg.1 + 1;
..
approximatelywitty-crayon-22786
03/27/2017, 7:02 PMrough-minister-58256
03/27/2017, 7:12 PMtempfile
, but that actually creates the File
object on your behalf (and requires external parent dir creation) which seemed a little less desirable to plumb than the tempdir + atomic # -> name -> file::File::create
we have nowwitty-crayon-22786
03/27/2017, 7:21 PMwitty-crayon-22786
03/27/2017, 7:54 PMfancy-queen-20734
03/27/2017, 8:48 PMwitty-crayon-22786
03/27/2017, 8:49 PMrough-minister-58256
03/27/2017, 10:02 PMrough-minister-58256
03/27/2017, 10:02 PMwitty-crayon-22786
03/27/2017, 10:03 PMrough-minister-58256
03/27/2017, 10:03 PMrough-minister-58256
03/27/2017, 10:04 PM.pants.d/snapshots/.tmp/snapshots.$RANDOM_STR
going away and either recreating the same exact path or with a replacement approach create .pants.d/snapshots/.tmp/snapshots.$NEXT_RANDOM_STR
etcrough-minister-58256
03/27/2017, 10:04 PMrough-minister-58256
03/27/2017, 10:04 PMwitty-crayon-22786
03/27/2017, 10:09 PMrough-minister-58256
03/27/2017, 10:09 PMwitty-crayon-22786
03/27/2017, 10:09 PMrough-minister-58256
03/27/2017, 10:11 PMsafe_create_dir_all(self.snapshot_tmpdir.path())
rather than ~`self.snapshot_tmpdir = TempDir::new_in(…)` via a mutex.witty-crayon-22786
03/27/2017, 10:11 PMTempDir
. but probably.witty-crayon-22786
03/27/2017, 10:12 PMrough-minister-58256
03/27/2017, 10:12 PMTempDir::new
etc provide w/ retries and such - but the probability of keying back to the exact same TempDir
path is low afaict.witty-crayon-22786
03/27/2017, 10:12 PMrough-minister-58256
03/27/2017, 10:12 PMwitty-crayon-22786
03/27/2017, 10:12 PMrough-minister-58256
03/27/2017, 10:13 PMwitty-crayon-22786
03/27/2017, 10:13 PMwitty-crayon-22786
03/27/2017, 10:13 PMwitty-crayon-22786
03/27/2017, 10:14 PMrough-minister-58256
03/27/2017, 10:14 PMyou mention that the need to create the parent directory is an issue