Go 1.11 has reached end of support
and will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after theirdeprecation date. We
recommend that youmigrate to the latest supported version of Go.
Stay organized with collectionsSave and categorize content based on your preferences.
WhileCloud Storageis the recommended solution for reading and writing files in App Engine,
if your app only needs to write temporary files, you can use standard
Go 1.11 methods to write files to a directory named/tmp.
All files in this directory are stored in the instance's RAM, therefore writing
to/tmptakes up system memory. In addition, files in the/tmpdirectory are
only available to the app instance that created the files. When the instance is
deleted, the temporary files are deleted.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 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."]]