Create a List of File Update Paths in Python
October 2025
This is how I create a list of input files to make updates to and their corresponding output paths in an _updates
directory.
The idea is that you the new directory of files gets built with the same structure so you can move it in place when everything is done properly.
=
=
=
=
return
=
Output:
IN: recursive_test/1.txt
OUT: _updates/recursive_test/1.txt
IN: recursive_test/a/2.txt
OUT: _updates/recursive_test/a/2.txt
IN: recursive_test/a/c/4.txt
OUT: _updates/recursive_test/a/c/4.txt
IN: recursive_test/b/3.txt
OUT: _updates/recursive_test/b/3.txt
end of line