WARNING: The [sjs-3] engine was deprecated, use [sjs-4] instead.

File.prototype.name()

Returns a file’s name.

Syntax

file.name() string

Description

Returns a file’s name, which is the last segment of its path.

Examples

Name of a non-root file.

Name of the root file equals its domain.