I had this weird requirement. I had to copy a set of different files from different directories from a source folder to a target folder and preserve the directory structure. For instance
Source File: c:\temp\test\abc.txt
Target Folder: e:\test
Copy the Source File into the Target folder preserving the dir structure. I need to achieve the following after copying
e:\test\temp\test\abc.txt
The best solution is to create a jar/zip file and keep on appending it with the file entries. Then copy the jar/zip file to target folder and extract the files. This will keep the directories preserved.
Subscribe to:
Post Comments (Atom)
2 comments:
If you are in windows environment use
xcopy /e /s
Will try that next time
Post a Comment