Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Cloud Storage ist die empfohlene Lösung zum Lesen und Schreiben von Dateien in App Engine. Wenn Ihre Anwendung aber nur temporäre Dateien schreiben muss, können Sie mit den Standardmethoden von Go 1.11 Dateien in ein Verzeichnis mit dem Namen /tmp schreiben.
Alle Dateien in diesem Verzeichnis werden im RAM der Instanz gespeichert. Daher wird beim Schreiben in /tmp Systemarbeitsspeicher belegt. Darüber hinaus sind Dateien im Verzeichnis /tmp nur für die Anwendungsinstanz verfügbar, mit der die Dateien erstellt wurden. Wenn die Instanz gelöscht wird, werden auch die temporären Dateien gelöscht.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eCloud Storage is recommended for reading and writing files in App Engine, but \u003ccode\u003e/tmp\u003c/code\u003e can be used for temporary files.\u003c/p\u003e\n"],["\u003cp\u003eWriting to \u003ccode\u003e/tmp\u003c/code\u003e uses system memory because files are stored in the instance's RAM.\u003c/p\u003e\n"],["\u003cp\u003eFiles in \u003ccode\u003e/tmp\u003c/code\u003e are only accessible to the app instance that created them and are deleted when the instance is terminated.\u003c/p\u003e\n"],["\u003cp\u003eGo's \u003ccode\u003eTempDir\u003c/code\u003e and \u003ccode\u003eTempFile\u003c/code\u003e methods read and write files to the \u003ccode\u003e/tmp\u003c/code\u003e directory by default.\u003c/p\u003e\n"]]],[],null,["# Reading and Writing Temporary Files\n\nWhile [Cloud Storage](/appengine/docs/legacy/standard/go111/using-cloud-storage)\nis the recommended solution for reading and writing files in App Engine,\nif your app only needs to write temporary files, you can use standard\nGo 1.11 methods to write files to a directory named `/tmp`.\n\nAll files in this directory are stored in the instance's RAM, therefore writing\nto `/tmp` takes up system memory. In addition, files in the `/tmp` directory are\nonly available to the app instance that created the files. When the instance is\ndeleted, the temporary files are deleted.\n| Golang provides the [`TempDir`](https://golang.org/pkg/io/ioutil/#TempDir) and [`TempFile`](https://golang.org/pkg/io/ioutil/#TempFile) methods that read and write files to your app instance's `/tmp` directory by default."]]