Makes a new private directory in the temporary directory of the system
The watch mode and the browser levels of --check write a copy of the deck
into such a directory. Many computers have one /tmp for all the users, so
each directory obeys these rules:
- The name is
expresso-<kind>-<random>, and<random>has 26 random characters. File.mkdir/1makes the directory, so a directory or a symbolic link that is already there is an error. The function then tries a different name.- The mode of the directory is 0700, so no other user can read or write its files.
open!/1 also starts a small sh process that removes the directory when
the process that owns it stops, and when the VM stops. Ctrl-C and SIGTERM
halt the VM before an after block can run, but the operating system then
closes the pipe to the sh process, and that process removes the
directory. close/1 removes the directory at once.
Summary
Functions
Remove the directory, and stop its sh process
Make a new directory with the mode 0700 in parent, and return its path
Make a new private directory, and remove it when the calling process stops
Types
Functions
@spec close(t()) :: :ok
Remove the directory, and stop its sh process
Make a new directory with the mode 0700 in parent, and return its path
random returns the random part of each name that the function tries. The
tests give a different function.
Make a new private directory, and remove it when the calling process stops
The function raises when it cannot make the directory.