Note that there are some explanatory texts on larger screens.

plurals
  1. POCopy is not happening
    primarykey
    data
    text
    <p>Guyz - I am having this problem where shutil.copy tree thinks a directory exists even though it doesnt..both the source and directory are local...first time i ran it ran without errors but the content is actually not copied,second time it ran it thinks the directory already exists,details below..please provide your inputs,if there are any other ways to copy other than shutil..please suggest</p> <p>Firs time ran,without any errors but it was not actually copied</p> <pre><code> &lt;username:/local/mnt/workspace/username/Scripts&gt;python test.py //local/mnt/workspace/loc/04.01.01.00.303_HY11/out //local/mnt/workspace/test/out copying </code></pre> <p>Rerun second time,it thinks it thinks directory exists</p> <pre><code> &lt;username:/local/mnt/workspace/username/Scripts&gt;python test.py //local/mnt/workspace/loc/04.01.01.00.303_HY11/out //local/mnt/workspace/test/out copying Traceback (most recent call last): File "test.py", line 21, in &lt;module&gt; main() File "test.py", line 18, in main copytree(src,dst) File "test.py", line 11, in copytree shutil.copytree(s, d) File "/pkg/qct/software/python/2.5.2/.amd64_linux26/lib/python2.5/shutil.py", line 110, in copytree os.makedirs(dst) File "/pkg/qct/software/python/2.5.2/.amd64_linux26/lib/python2.5/os.py", line 171, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: '//local/mnt/workspace/test/out' &lt;username:/local/mnt/workspace/username/Scripts&gt; </code></pre> <p>Python code</p> <pre><code>import os,shutil def copytree(src, dst, symlinks=False, ignore=None): for item in os.listdir(src): s = os.path.join(src, item) print s d = os.path.join(dst, item) print d if os.path.isdir(s): print "copying" shutil.copytree(s, d, symlinks, ignore) else: shutil.copy2(s, d) def main (): src="//local/mnt/workspace/loc/04.01.01.00.303_HY11" dst="//local/mnt/workspace/test" copytree(src,dst) if __name__ == '__main__': main() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload