Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of same name.

satishmlwizpro at gmail.com satishmlwizpro at gmail.com
Mon May 19 02:53:21 EDT 2014


Hi,

Consider
/src/alias/a.c
/src/alias/b.c
/src/xml/p.xml
/src/xml/c.xml
/src/h.c
as source directory 
and 
/dest/alias
/dest/xml
/dest
as destination directory. These are given in a csv file like
/src/alias/a.c, /dest/alias
/src/alias/b.c, /dest/alias
/src/xml/p.xml, /dest/xml
/src/xml/c.xml, /dest/xml
/src/h.c, /dest
Python code should read csv file. Copy files from source to destination(files in /src/alias should be copied to /dest/alias and not to /dest/xml i.e., directory names should be the same). If /dest contains same files as /src, then they code should give us a warning and such files shouldn't be copied. Other files should only be copied.

Could you kindly help?



More information about the Python-list mailing list