Helper to create temporary directory.

import * as fs from 'LensStudio:FileSystem';

const resourceName = "resourceName.txt";

// Create a temporary dir
const tempDir = fs.TempDir.create();

// Create a path that we want to write file to
const resourcePath = tempDir.path;
resoursePath.append(resourceName);

// Write to the file
fs.writeFile(resourceName, "Hello World");
interface TempDir {
    path: Path;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

Methods

Properties

path: Path

Methods