Helper to create temporary directory.
import * as fs from 'LensStudio:FileSystem';const resourceName = "resourceName.txt";// Create a temporary dirconst tempDir = fs.TempDir.create();// Create a path that we want to write file toconst resourcePath = tempDir.path;resoursePath.append(resourceName);// Write to the filefs.writeFile(resourceName, "Hello World"); Copy
import * as fs from 'LensStudio:FileSystem';const resourceName = "resourceName.txt";// Create a temporary dirconst tempDir = fs.TempDir.create();// Create a path that we want to write file toconst resourcePath = tempDir.path;resoursePath.append(resourceName);// Write to the filefs.writeFile(resourceName, "Hello World");
Protected
Readonly
Static
Creates a temporary directory which will be deleted the moment all references to it disappears.
Helper to create temporary directory.
Example