<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copy files Problem? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140564#M10948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander.&lt;/P&gt;&lt;P&gt;Nontheless this was the best solution for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sys.platform == 'win32':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.system('xcopy "%s" "%s"' % (src, dest) + " /Y /M /S /E")&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutil.copy(src, dest)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2015 09:29:15 GMT</pubDate>
    <dc:creator>JohannesBierer</dc:creator>
    <dc:date>2015-01-15T09:29:15Z</dc:date>
    <item>
      <title>Copy files Problem?</title>
      <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140560#M10944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't copy files?&lt;/P&gt;&lt;P&gt;IOError: [Errno 13] Permission denied:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import shutil, os, sys

src = r"R:\natura 2000\8847.04 MaP\6417-341_Weschnitz_Bergstrasse_Odenwald"
dest = "H:\\test"

ret = os.access(src, os.F_OK)
print "F_OK - return value %s"% ret

ret = os.access(src, os.R_OK)
print "R_OK - return value %s"% ret

ret = os.access(src, os.W_OK)
print "W_OK - return value %s"% ret

ret = os.access(src, os.X_OK)
print "X_OK - return value %s"% ret

shutil.copyfile(src, dest)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F_OK - return value True&lt;/P&gt;&lt;P&gt;R_OK - return value True&lt;/P&gt;&lt;P&gt;W_OK - return value True&lt;/P&gt;&lt;P&gt;X_OK - return value True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "R:\Karto\zGIS\Python\OrdnerKopieren.py", line 86, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutil.copyfile(src, dest)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\shutil.py", line 81, in copyfile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(src, 'rb') as fsrc:&lt;/P&gt;&lt;P&gt;IOError: [Errno 13] Permission denied: 'R:\\natura 2000\\8847.04 MaP\\6417-341_Weschnitz_Bergstrasse_Odenwald'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140560#M10944</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-12-11T07:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Copy files Problem?</title>
      <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140561#M10945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the documentation:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;EM&gt;&lt;EM style="background-color: #f6f6f6;"&gt;shutil.copyfile(src, dst)&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Copy the contents (no metadata) of the file named src to a file named dst. dst must be &lt;STRONG&gt;the complete target file&lt;/STRONG&gt; name; look at &lt;STRONG&gt;copy()&lt;/STRONG&gt; for a copy that accepts a target directory path.&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 12:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140561#M10945</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-14T12:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Copy files Problem?</title>
      <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140562#M10946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but didn't helped. shutil.move does work?&lt;/P&gt;&lt;P&gt;Do u know how to print information about copy speed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 14:03:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140562#M10946</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2015-01-14T14:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Copy files Problem?</title>
      <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140563#M10947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is a matter of speeding up the copy process of large files, you may want to look at this article: &lt;A href="http://blogs.blumetech.com/blumetechs-tech-blog/2011/05/faster-python-file-copy.html" title="http://blogs.blumetech.com/blumetechs-tech-blog/2011/05/faster-python-file-copy.html"&gt;Faster Python File Copy - Blumetech's Tech Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to record the time it took to copy the file, you can record the current time just before and just after and determine the timedelta or read the post by &lt;A href="https://community.esri.com/migrated-users/8225"&gt;Owen Earley&lt;/A&gt;‌: &lt;A _jive_internal="true" href="https://community.esri.com/thread/119781#448946" title="https://community.esri.com/thread/119781#448946"&gt;https://community.esri.com/thread/119781#448946&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 14:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140563#M10947</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-14T14:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Copy files Problem?</title>
      <link>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140564#M10948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander.&lt;/P&gt;&lt;P&gt;Nontheless this was the best solution for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sys.platform == 'win32':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.system('xcopy "%s" "%s"' % (src, dest) + " /Y /M /S /E")&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutil.copy(src, dest)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 09:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/copy-files-problem/m-p/140564#M10948</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2015-01-15T09:29:15Z</dc:date>
    </item>
  </channel>
</rss>

