Function ggstd::os::mkdir_temp
source · pub fn mkdir_temp(dir: Option<&Path>, pattern: &str) -> Result<PathBuf>Expand description
mkdir_temp creates a new temporary directory in the directory dir and returns the pathname of the new directory. The new directory’s name is generated by adding a random string to the end of pattern. If pattern includes a “”, the random string replaces the last “” instead. If dir is the empty string, mkdir_temp uses the default directory for temporary files, as returned by temp_dir. Multiple programs or goroutines calling mkdir_temp simultaneously will not choose the same directory. It is the caller’s responsibility to remove the directory when it is no longer needed. TempDir can be used as a more convenient interface for creating and automatically removing a temporary directory.