FileSystem
File system utilities.
Initializers
import { FileSystem } from '@alicloud/ros-cdk-core'
new FileSystem()
Name | Type | Description |
---|---|---|
Static Functions
Name | Description |
---|---|
copyDirectory |
Copies an entire directory structure. |
fingerprint |
Produces fingerprint based on the contents of a single file or an entire directory tree. |
isEmpty |
Checks whether a directory is empty. |
mkdtemp |
Creates a unique temporary directory in the system temp directory. |
copyDirectory
import { FileSystem } from '@alicloud/ros-cdk-core'
FileSystem.copyDirectory(srcDir: string, destDir: string, options?: CopyOptions, rootDir?: string)
Copies an entire directory structure.
- Type: string
Source directory.
- Type: string
Destination directory.
- Type: CopyOptions
options.
- Type: string
Root directory to calculate exclusions from.
fingerprint
import { FileSystem } from '@alicloud/ros-cdk-core'
FileSystem.fingerprint(fileOrDirectory: string, options?: FingerprintOptions)
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.
- Type: string
The directory or file to fingerprint.
- Type: FingerprintOptions
Fingerprinting options.
isEmpty
import { FileSystem } from '@alicloud/ros-cdk-core'
FileSystem.isEmpty(dir: string)
Checks whether a directory is empty.
- Type: string
The directory to check.
mkdtemp
import { FileSystem } from '@alicloud/ros-cdk-core'
FileSystem.mkdtemp(prefix: string)
Creates a unique temporary directory in the system temp directory.
- Type: string
A prefix for the directory name.
Six random characters will be generated and appended behind this prefix.
Properties
Name | Type | Description |
---|---|---|
tmpdir |
string |
The real path of the system temp directory. |
tmpdir
Required
public readonly tmpdir: string;
- Type: string
The real path of the system temp directory.