---
title: "Creating Names"
canonical: "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/create-name.html"
source: "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/create-name.md"
part: "The Magma Language"
chapter: "Input and Output"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "The Magma Language", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/index-magma-language.md"}
  - {"title": "Input and Output", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/index-input-output.md"}
prev: {"title": "System Calls", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/InputOutput/system-calls-2.md"}
next: {"title": "Environment and Options", "source": "https://docs.magma-maths.org/v2.30-1/MagmaLanguage/EnvironmentAndOptions/index-environment-and-options.md"}
intrinsics:
  - {"name": "Tempname", "signature": "Tempname(P): MonStgElt -> MonStgElt"}
---

# Creating Names

Sometimes it is necessary to create names for files from within Magma that will not clash with the names of existing files.

<a id="function-tempname-monstgelt"></a>
## `Tempname(P): MonStgElt -> MonStgElt`

Given a prefix string $P$, return a unique temporary name derived from $P$ (by use of the C library function `mktemp()`).
