aws-cdk-lib.FileSystem

class FileSystem

LanguageType name
.NETAmazon.CDK.FileSystem
Gogithub.com/aws/aws-cdk-go/awscdk/v2#FileSystem
Javasoftware.amazon.awscdk.FileSystem
Pythonaws_cdk.FileSystem
TypeScript (source)aws-cdk-lib » FileSystem

File system utilities.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const fileSystem = new cdk.FileSystem();

Initializer

new FileSystem()

Properties

NameTypeDescription
static tmpdirstringThe real path of the system temp directory.

static tmpdir

Type: string

The real path of the system temp directory.

Methods

NameDescription
static copyDirectory(srcDir, destDir, options?, rootDir?)Copies an entire directory structure.
static fingerprint(fileOrDirectory, options?)Produces fingerprint based on the contents of a single file or an entire directory tree.
static isEmpty(dir)Checks whether a directory is empty.
static mkdtemp(prefix)Creates a unique temporary directory in the system temp directory.

static copyDirectory(srcDir, destDir, options?, rootDir?)

public static copyDirectory(srcDir: string, destDir: string, options?: CopyOptions, rootDir?: string): void

Parameters

  • srcDir string — Source directory.
  • destDir string — Destination directory.
  • options CopyOptions — options.
  • rootDir string — Root directory to calculate exclusions from.

Copies an entire directory structure.


static fingerprint(fileOrDirectory, options?)

public static fingerprint(fileOrDirectory: string, options?: FingerprintOptions): string

Parameters

  • fileOrDirectory string — The directory or file to fingerprint.
  • options FingerprintOptions — Fingerprinting options.

Returns

  • string

Produces fingerprint based on the contents of a single file or an entire directory tree.

The fingerprint will also include:

  1. An extra string if defined in options.extra.
  2. The set of exclude patterns, if defined in options.exclude
  3. The symlink follow mode value.

static isEmpty(dir)

public static isEmpty(dir: string): boolean

Parameters

  • dir string — The directory to check.

Returns

  • boolean

Checks whether a directory is empty.


static mkdtemp(prefix)

public static mkdtemp(prefix: string): string

Parameters

  • prefix string — A prefix for the directory name.

Returns

  • string

Creates a unique temporary directory in the system temp directory.