move /copy dir
Blitz3D Forums/Blitz3D Beginners Area/move /copy dir
| ||
i will move a komplett directory any tipps ? |
| ||
He wants to copy/move a complete directory. [OT] will heißt werden, komplett ist deutsch |
| ||
I am going to give you the short answer here. If the target directory does not exist, you have to create it first. You have to make a list of all the files in the old directory. You go through the list and open each found file for reading. Make sure you do NOT try to open and read the file marked "." or "..". The first is just a pointer to this directory. The second is a pointer to this directory's parent directory. In the new directory, you open a file of the same name for writing. The commands for doing all these things are generally described in the Help section under File. In order to actually copy the contents of each file, you use some of the commands under the File/Stream section in the Help section. Noteably, you need to check for EOF() of the file being read, ReadString() to read from the file being read, and WriteString() to write to the new file. When you get to EOF(), then you close both files. You continue to do this until all the source directory files have been copied. You also have the option of shelling out of your program and running a Windows/DOS "copy" command instead, which some people may prefer as they see it as being a lot easier. You can also search the forums and sample/example files for code that does pretty much what you want, then use your growing expertise to modify it to do exactly what you want. Or some body may decide to be generous and supply the code here. But keep in mind, once a task as been accomplished well, it is often better to cull it from existing sources rather than ask if someone do it over again for you. |
| ||
he oldefox many thx for your answer . iam ready now ! |