ballerina-library
ballerina-library copied to clipboard
`file:copy` does not create missing directories in destination path
Description: $Subject.
$Subject. This doesn't return any error and works as a success case. However, the file is not copied to the destination. This should ideally copy the file by creating required dirs or return an error.
This only happens when the destination path directories does not exist.
Steps to reproduce:
- create a insert.sql file in package dir.
- run the following code.
import ballerina/file;
import ballerina/io;
public function main() returns error? {
string sourcePath = "insert.sql";
string destPath = "foo/insert.sql";
file:Error? copy = file:copy(sourcePath, destPath);
if copy is file:Error {
io:println(copy.message());
}
io:println("done");
}
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):