Skip to main content

LensStudio:FileSystem.TempDir

Class

Helper to create temporary directory.

Index

Example

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");

Extends

Properties

path

readonly path: Path

Filesystem path to the temporary directory.

Methods

create()

static create(): TempDir

Creates a temporary directory which will be deleted the moment all references to it disappears.

Returns

TempDir


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame