add SubmitDirManager for EventLoop
This combines two updates into one: It creates a new manager, that takes care of everything related to handling the submission directory itself. And it defines a series of modes for creating the submission directory.
The modes for the submission directory are probably more interesting for the users. There are now for modes:
-
"no_clobber": create the directory and if that fails raise an error. this is the default behavior we had so far.
-
"overwrite": create the directory, removing anything in the way. this was the behavior so far when
optRemoveSubmitDir
was specified. -
"unique": append a unique suffix to the submit directory name. this is mostly meant for unit-tests in which one may specify the same submit directory multiple times or in multiple tests.
-
"unique-link": same as "unique" but create a link under the officially requested name to point to the newly created directory, replacing any previously existing link. the idea is that this is mostly consistent with the old behavior while not requiring the user to remove the submit directory, and indeed keeping a history of all past submissions.
The unique directories will be named something like
submitDir-2019-08-22-1438-95f6
, which is essentially the originally
requested name, the date-time, and some random digits to make this
unique if several submissions happen in quick succession. The date
comes first so that directories are ordered by date-time. The actual
date format can be configured, if desired.
I did not change the default behavior (hopefully), but if people like it we could probably make "unique-link" the default mode instead of "no-clobber", as it ought to be almost completely backwards compatible.