File.cd-exclamation-mark
You're seeing just the function
cd-exclamation-mark
, go back to File module for more information.
Specs
cd!(Path.t()) :: :ok
The same as cd/1
, but raises a File.Error
exception if it fails.
Specs
cd!(Path.t(), (() -> res)) :: res when res: var
Changes the current directory to the given path
,
executes the given function and then reverts back
to the previous path regardless of whether there is an exception.
The current working directory is temporarily set for the BEAM globally. This
can lead to race conditions if multiple processes are changing the current
working directory concurrently. To run an external command in a given
directory without changing the global current working directory, use the
:cd
option of System.cmd/3
and Port.open/2
.
Raises an error if retrieving or changing the current directory fails.