File.rename

You're seeing just the function rename, go back to File module for more information.
Link to this function

rename(source, destination)

View Source (since 1.1.0)

Specs

rename(Path.t(), Path.t()) :: :ok | {:error, posix()}

Renames the source file to destination file. It can be used to move files (and directories) between directories. If moving a file, you must fully specify the destination filename, it is not sufficient to simply specify its directory.

Returns :ok in case of success, {:error, reason} otherwise.

Note: The command mv in Unix-like systems behaves differently depending on whether source is a file and the destination is an existing directory. We have chosen to explicitly disallow this behaviour.

Examples

# Rename file "a.txt" to "b.txt"
File.rename("a.txt", "b.txt")

# Rename directory "samples" to "tmp"
File.rename("samples", "tmp")