Context
I have a list of filenames (many tens of thousands) that I would like to locate within a directory. For all files that are located they must be copied to a single output folder.
Using Python, what would be, in your opinion, the most efficient* strategy for doing this? I'm not looking for a solution, but good strategy to get started.
To break this down:
- How the list of filenames should be stored and the method of searching if a filename is in the list?
- How to go through an entire directory, folder by folder, and consider each file in tern?
- How to copy the file (least processing time)?
Caveat
*efficient in the sense that the script execution should not 'hog' system's resources. Other more important applications maybe running concurrently.
Many thanks!