Backing up folders/files
Blitz3D Forums/Blitz3D Programming/Backing up folders/files
| ||
| I want to write a routine to backup my game folder. So far I can only see the Copyfile command which copies files only. Is there a way to copy an entire folder and it's contents in Blitz? |
| ||
| Don't think so. However, you can Create a folder - so, technically, you can do it by creating the copy directory (naming it to whatever you want) first then copy the files into it. |
| ||
| Recursive file copy. i.e.
Function FileCopy()
Repeat
Is filetype a file, or folder?
If file, copy file
If folder, update path and call FileCopy()
Until no more files/subfolders in folder
End Function |
| ||
| Thanks. I tried it and got a bit stuck, but then I found a sample in the archives which does exactly as you suggested..... it's at http://www.blitzbasic.com/codearcs/codearcs.php?code=677 |