class FileSystem
Language | Type name |
---|---|
.NET | Amazon.CDK.FileSystem |
Java | software.amazon.awscdk.core.FileSystem |
Python | aws_cdk.core.FileSystem |
TypeScript (source) | @aws-cdk/core » 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/core';
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. |
Directory(srcDir, destDir, options?, rootDir?)
static copypublic 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.
The fingerprint will also include:
- An extra string if defined in
options.extra
. - The set of exclude patterns, if defined in
options.exclude
- The symlink follow mode value.
Empty(dir)
static ispublic 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.