class FileSystem
| Language | Type name |
|---|---|
.NET | Amazon.CDK.FileSystem |
Go | github.com/aws/aws-cdk-go/awscdk/v2#FileSystem |
Java | software.amazon.awscdk.FileSystem |
Python | aws_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
| Name | Type | Description |
|---|---|---|
| static tmpdir | string | The real path of the system temp directory. |
static tmpdir
Type:
string
The real path of the system temp directory.
Methods
| Name | Description |
|---|---|
| static copy | 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 is | 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
Copy— options.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
Fingerprint— Fingerprinting options.Options
Returns
string
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:
- An extra string if defined in
options.extra. - 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.

.NET
Go
Java
Python
TypeScript (