# FileSystem

File system utilities.

- Source: [`core/lib/fs/index.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/fs/index.ts#L15)
- Type last changed: v2.225.0 · 17 Nov 2025

## Example

```ts
// 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

```ts
new FileSystem()
```

## Properties

- `tmpdir`: string (static) — The real path of the system temp directory.

## Methods

- `copyDirectory(srcDir: string, destDir: string, options?: CopyOptions, rootDir?: string): void` (static) — Copies an entire directory structure.

  **Parameters**

  - `srcDir` — Source directory.
  - `destDir` — Destination directory.
  - `options` — options.
  - `rootDir` — Root directory to calculate exclusions from.

- `fingerprint(fileOrDirectory: string, options?: FingerprintOptions): string` (static) — Produces fingerprint based on the contents of a single file or an entire directory tree.

  Line endings are converted from CRLF to LF.

  The fingerprint will also include:
  1. An extra string if defined in `options.extra`.
  2. The symlink follow mode value.

  **Parameters**

  - `fileOrDirectory` — The directory or file to fingerprint.
  - `options` — Fingerprinting options.

- `isEmpty(dir: string): boolean` (static) — Checks whether a directory is empty.

  **Parameters**

  - `dir` — The directory to check.

- `mkdtemp(prefix: string): string` (static) — Creates a unique temporary directory in the **system temp directory**.

  **Parameters**

  - `prefix` — A prefix for the directory name.

- `rmrf(dirname: string): void` (static) — Deletes a directory.
