I've got a pretty simple script that looks for the latest/newest file in a folder and copies it into a new location. The script works fine when run through a python GUI, but when run as a part of an Arc model, fails. Can someone translate the error for me? I don't understand why this is happening?
<SPAN class="keyword token">import</SPAN> glob
<SPAN class="keyword token">import</SPAN> os
<SPAN class="keyword token">import</SPAN> shutil
<SPAN class="keyword token">import</SPAN> time
date <SPAN class="operator token">=</SPAN> time<SPAN class="punctuation token">.</SPAN>strftime<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"%Y-%m-%d"</SPAN><SPAN class="punctuation token">)</SPAN>
dst <SPAN class="operator token">=</SPAN> <SPAN class="string token">"//10.253.2.161/cddp/Bunbury Use Only/GeoMasterPatchArchives/"</SPAN> <SPAN class="operator token">+</SPAN> date
list_of_files <SPAN class="operator token">=</SPAN> glob<SPAN class="punctuation token">.</SPAN>glob<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'//gis/Geomaster/*.bak'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># * means all if need specific format then *.csv</SPAN>
latest_file <SPAN class="operator token">=</SPAN> max<SPAN class="punctuation token">(</SPAN>list_of_files<SPAN class="punctuation token">,</SPAN> key<SPAN class="operator token">=</SPAN>os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>getctime<SPAN class="punctuation token">)</SPAN>
shutil<SPAN class="punctuation token">.</SPAN>copy<SPAN class="punctuation token">(</SPAN>latest_file<SPAN class="punctuation token">,</SPAN> dst<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> latest_file <SPAN class="operator token">+</SPAN> <SPAN class="string token">" copied to backup folder"</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
