...
Code Block |
---|
Copyroot("Update", "Myapplication") Sub copyroot(path$ as string, Target$ as String) mylist = listdir(path$) For each item in mylist if instr(1, item, ".") > 0 then print "found a file: "; item print "path: "; path$ CopyFile(path$+"\"+item, Target$+"\"+item) else print "found folder: " ;item CreateDirectory(Target$+"\"+item) copytree("\"+item) endif next end Sub Sub Copytree(path$ as string) print "copy tree: "; path$ 'e.g. \pool mylistb = listdir("\Update"+path$) print mylistb For each item in mylistb print len(item) if instr(1, item, ".") > 0 then CopyFile("\\Update"+path$+"\\"+item, Target$+path$) if len(item) > 1 then print "copying sha file: "; Target$+path$+"\\"+item showstatus("copying file: "+ Target$+path$+"\\"+item) CopyFile("\\Update"+path$+"\\"+item, Target$+path$+"\\"+item) 'folders only 1 digit long outside root ? else print "found sub folder: "; path$+"\\"+item CreateDirectory(Target$+path$+"\\"+item) copytree(path$+"\\"+item) endif next |