Skip to content

Glob

[Source]

Filename matching and globbing with shell patterns.

fnmatch(file_name, pattern) matches according to the local convention. fnmatchcase(file_name, pattern) always takes case into account. The functions operate by translating the pattern into a regular expression.

The function translate(PATTERN) returns a regular expression corresponding to PATTERN.

Patterns are Unix shell style: * | matches multiple characters within a directory ** | matches multiple characters across directories ? | matches any single character [seq] | matches any character in seq [!seq] | matches any char not in seq

primitive val Glob

Constructors

create

[Source]

new val create()
: Glob val^

Returns


Public Functions

fnmatch

[Source]

Tests whether name matches pattern.

An initial period in name is not special.

Both name and pattern are first case-normalized if the operating system requires it. If you don't want this, use fnmatchcase.

fun box fnmatch(
  name: String val,
  pattern: String val)
: Bool val

Parameters

Returns


fnmatchcase

[Source]

Tests whether name matches pattern, including case.

fun box fnmatchcase(
  name: String val,
  pattern: String val)
: Bool val

Parameters

Returns


filter

[Source]

Returns name and the matching subgroups for names that match pattern.

All strings are first case-normalized if the operating system requires it.

fun box filter(
  names: Array[String val] ref,
  pattern: String val)
: Array[(String val , Array[String val] ref)] val

Parameters

Returns


translate

[Source]

Translates a shell pattern to a regular expression. There is no way to quote meta-characters.

fun box translate(
  pat: String val)
: String ref^

Parameters

Returns


glob

[Source]

Returns an Array[FilePath] for each path below root_path that matches pattern.

The pattern may contain shell-style wildcards. See the type documentation on Glob for details.

fun box glob(
  root_path: FilePath val,
  pattern: String val)
: Array[FilePath val] ref

Parameters

Returns


iglob

[Source]

Calls GlobHandler.apply for each path below root that matches pattern.

The pattern may contain shell-style wildcards. See the type documentation on Glob for details.

fun box iglob(
  root: FilePath val,
  pattern: String val,
  glob_handler: GlobHandler ref)
: None val

Parameters

Returns


eq

[Source]

fun box eq(
  that: Glob val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Glob val)
: Bool val

Parameters

Returns