0

I am trying to copy folders from one location to other. Here, I have two folders test/ , sanity/ which are symlinks to other folders.

When i try to copy, Those two folders are not copied as links. Instead, They are copying as normal directories.

i am using python 2.7 and trying to use 'shutil.copytree'

build_path=/home/usb/builds/
build_folders = os.listdir(build_path) 
for folder in build_folders:
   src_path=os.path.join(build_path,folder)
   dst_path=os.path.join(Temp_dir,folder)
   shutil.copytree(src_path,dst_path,symlinks=True)

/home/usb/builds/ has folders which needs to copy. Here is the list below.

   test -> usb/test
   sanity -> usb/sanity
   usb
   logs
   libraries

Above test, sanity is softlinks. They were copying as normal directories.

Can you please help?

santosh
  • 421
  • 1
  • 6
  • 14

0 Answers0