The file:copy() function works not as it described in the documentation
Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
When you run the following script twice BaseX returns the next error message with its code
[file:is-dir] '/Users/user/target/2' is a directory.
The code
let $d1 := file:create-dir("./1")
let $d2 := file:create-dir("./1/2")
let $d3 := file:create-dir("./target")
let $f := file:write-text("./1/2/3.txt","Hey!")
for $i in file:children("./1")
return
file:copy($i,"./target")
Expected Behavior
No errors
Steps to Reproduce the Behavior
Run the script
Run the script again
Do you have an idea how to solve the issue?
No response
What is your configuration?
java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment Temurin-11.0.16+8 (build 11.0.16+8)
OpenJDK 64-Bit Server VM Temurin-11.0.16+8 (build 11.0.16+8, mixed mode)
Description of the Problem
Hello BaseX team!
The file:copy() function works not as it described in the documentation
When you run the following script twice BaseX returns the next error message with its code
The code
Expected Behavior
No errors
Steps to Reproduce the Behavior
Do you have an idea how to solve the issue?
No response
What is your configuration?
Launch script
java -cp BaseX100.jar:./lib/* org.basex.BaseXGUI
LibrariesMacOS Big Sur 11.6.8