createFileWithDummy
Requires a Node.js runtime ('qsu/node')Creates a file with the specified size in bytes. A size of 0 creates an empty file, and a negative size raises an error.
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
filePath | stringStringstr | ● | – |
| File or directory path | |||
size named keyword | numberint | ● | – |
| Size of the file to be created (Dummy data is filled as much as the given size) | |||
namedThese parameters are passed as named parameters.
keywordThese parameters are passed as keyword arguments, or as a single dict in their place.
Returns
Promise<boolean>
Future<bool>
bool
Examples
javascript
await createFileWithDummy('/home/user/test.txt', 100000);
// A size of 0 creates an empty file; a negative size throws
await createFileWithDummy('/home/user/empty.txt', 0);dart
await createFileWithDummy('/home/user/test.txt', size: 100000);
// A size of 0 creates an empty file; a negative size throws
await createFileWithDummy('/home/user/empty.txt', size: 0);python
createFileWithDummy('/home/user/test.txt', 100000)
# A size of 0 creates an empty file; a negative size raises
createFileWithDummy('/home/user/empty.txt', 0)