Sub CopyDirectory(source As String, dest As String)
Dim al As List = File.ListFiles(source)
For Each s As String In al
If File.IsDirectory(source, s) Then
CopyDirectory(File.Combine(source, s), File.Combine(dest, s))
Else
File.Copy(source, s, dest, s)
End If
Next
End Sub
1. B4J: download the lib : db2000.B4J.eXtrafunctions.zip
2. extract the *.jar and *.xml into your additional lib folder
3. in your project, choose the lib
4. CopyDirectory("d:/path/of/folder/to/copy", "d:/path/of/target/folder/")
1. B4J: download the lib : db2000.B4J.eXtrafunctions.zip
2. extract the *.jar and *.xml into your additional lib folder
3. in your project, choose the lib
4. CopyDirectory("d:/path/of/folder/to/copy", "d:/path/of/target/folder/")
B4J version: 4.00
Parsing code. Error
Error parsing program.
Error description: Undeclared variable 'copydirectory' is used before it was assigned any value.
Occurred on line: 120 (Main)
CopyDirectory(File.DirApp&"\4", File.DirData("xTest"))
the code as given by Roycefer works.
Actually i want to copy a folder inside assets to Data directory. How is this possible?
The snippet in my earlier post should work with the File.DirAssets directory as the source. Of course, it won't work with that as the destination as you can't write to File.DirAssets.
By "Data directory", do you mean the directory returned by File.DirData("appname")? Just pass that as the dest parameter.
The snippet in my earlier post should work with the File.DirAssets directory as the source. Of course, it won't work with that as the destination as you can't write to File.DirAssets.
By "Data directory", do you mean the directory returned by File.DirData("appname")? Just pass that as the dest parameter.