<?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 Access is Denied (os.remove) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273580#M21131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to create a DDP export to PDF script that uses the ESRI Example from South Kingstown, RI, and when I run my script I get this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Runtime error&amp;nbsp; Traceback (most recent call last): &amp;nbsp; File "&amp;lt;string&amp;gt;", line 17, in &amp;lt;module&amp;gt; WindowsError: [Error 5] Access is denied: 'R:\\GIS\\...\\PDF'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thinks due to this bit of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if multiPage == "true": &amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.exists(outputPDF): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(outputPDF)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #Create new FinalMapBook that results will be appeneded into &amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook = arcpy.mapping.PDFDocumentCreate(outputPDF)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have full access to the drive and the folder.&amp;nbsp; I tried my local drive and I get the same error.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Aug 2013 15:57:10 GMT</pubDate>
    <dc:creator>GeoffOlson</dc:creator>
    <dc:date>2013-08-20T15:57:10Z</dc:date>
    <item>
      <title>Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273580#M21131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to create a DDP export to PDF script that uses the ESRI Example from South Kingstown, RI, and when I run my script I get this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Runtime error&amp;nbsp; Traceback (most recent call last): &amp;nbsp; File "&amp;lt;string&amp;gt;", line 17, in &amp;lt;module&amp;gt; WindowsError: [Error 5] Access is denied: 'R:\\GIS\\...\\PDF'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thinks due to this bit of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if multiPage == "true": &amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.exists(outputPDF): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(outputPDF)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #Create new FinalMapBook that results will be appeneded into &amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook = arcpy.mapping.PDFDocumentCreate(outputPDF)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have full access to the drive and the folder.&amp;nbsp; I tried my local drive and I get the same error.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 15:57:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273580#M21131</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2013-08-20T15:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273581#M21132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post the whole script please? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure you're passing a file path and not just a directory path too. I think that will cause an error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 16:16:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273581#M21132</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2013-08-20T16:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273582#M21133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I noticed it was just a folder location listed, I set the tool parameter wrong.&amp;nbsp; But when I do specify a file name, the tool won't run because it says the file doesn't exist.&amp;nbsp; I don't have the problem when I won't run a multi-page pdf export, but it doesn't create documents either.&amp;nbsp; I don't know what changed to keep it from the file creation, but it says it completes the script on single page PDFs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys

#set map doc and the layer to be used
mxd = arcpy.mapping.MapDocument("Current")
mapLyr = arcpy.mapping.ListLayers(mxd, "Detail_2013")[0]



#Get input parameters
pageNumList = arcpy.GetParameterAsText(0).split(";")
multiPage = arcpy.GetParameterAsText(1)
outputPDF = arcpy.GetParameterAsText(2)


if multiPage == "true":
&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.exists(outputPDF):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(outputPDF)

&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create new FinalMapBook that results will be appeneded into
&amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook = arcpy.mapping.PDFDocumentCreate(outputPDF)




#Listing the text elements on the page
concatElem1 = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "concat1")[0]
concatElem2 = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "concat2")[0]


#Get page number from data driven page - specified in the tool parameter dialogue box
ddp = mxd.dataDrivenPages





for pageNum in pageNumList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(pageNum)
&amp;nbsp;&amp;nbsp;&amp;nbsp; pageID = mxd.dataDrivenPages.getPageIDFromName(str(pageNum))
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageID
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Set layer definition query, this contols the rowcount variable
&amp;nbsp;&amp;nbsp;&amp;nbsp; pageFieldValue = pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapLyr.definitionQuery = '"pageNum" = %s' % pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Finds the number of features in the map and sets up the lists to evenly distribute into the two text elements/columns
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowcount = int(arcpy.GetCount_management("Detail_2013").getOutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; percolumn = round(rowcount / 2.0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; count1 = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; count2 = rowcount

&amp;nbsp;&amp;nbsp;&amp;nbsp; #Specifies the features being used for the SearchCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(mapLyr, "", "", "CONCAT")
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldrow&amp;nbsp; = arcpy.SearchCursor(mapLyr, "", "", "pageNum")
&amp;nbsp;&amp;nbsp;&amp;nbsp; currentpage = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp; text_var1 = str()
&amp;nbsp;&amp;nbsp;&amp;nbsp; text_var2 = str()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in fieldrow:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if currentpage != row.pageNum:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentpage = row.pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if count1 &amp;lt;= percolumn:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text_var1 += '{0}{1}'.format(row.getValue("CONCAT"), os.linesep)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatElem1.text = text_var1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count1 += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif count2 &amp;gt; percolumn:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text_var2 += '{0}{1}'.format(row.getValue("CONCAT"), os.linesep)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatElem2.text = text_var2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count2 - 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Generate multi-page PDF file or single PDF files 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if multiPage == "true": #Appends all PDFs into single, multi-page PDF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, outputPDF[:-4] + pageNum + ".pdf") #strip away .pdf, add platnum value and add ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook.appendPages(outputPDF[:-4] + pageNum + ".pdf") #append page to final PDF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(outputPDF[:-4] + pageNum + ".pdf")&amp;nbsp; #no longer needed once appended
&amp;nbsp;&amp;nbsp;&amp;nbsp; else: #Create individual PDFs for each page
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, outputPDF[:-4] + pageNum + ".pdf")

#Add PDF properties for multi-page PDF
if multiPage == "true":
&amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook.updateDocProperties("2010-2011 Crash Report", "2010-2011 Crash Report", "map sheets, map book", "USE_THUMBS")
&amp;nbsp;&amp;nbsp;&amp;nbsp; finalMapBook.saveAndClose()

arcpy.RefreshActiveView()
arcpy.AddMessage("PROCESS COMPLETED")


#Removed the definition query so all page numbers appear when the script is run next and refresh he layout view
mapLyr.definitionQuery = ""
arcpy.RefreshActiveView()
del mxd, row, rows, rowcount, percolumn, count1, count2&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273582#M21133</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2021-12-11T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273583#M21134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you say the tool won't run (after correcting the path issue), is it that you get the same error, or the tool dialog itself shows an issue (red X)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's the tool dialog, then you might need to adjust how the parameter is set up. If it's set up as a 'file', validation does check if the file exists.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 17:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273583#M21134</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2013-08-20T17:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273584#M21135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What happens if you hard code your outputPDF?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;outputPDF = r"C:\Project\MapBook.pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and make sure the C:\Project folder exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering if the path isn't being passed correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 17:29:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273584#M21135</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-08-20T17:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273585#M21136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in addition to rzufelt comment, I have had issues of paths not being passed back correctly to the script. On a couple of occasions I have had the path of the scrip prefixed to the path being passed eg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;c:\data\tools\script.py d:\work\output.pdf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a few solutions that worked for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Just re linking the script to the tool - not practical but did work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. was using code like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;scriptPath = os.path.dirname(sys.argv[0])
ccPath = os.path.join(os.path.dirname(scriptPath),"ToolData","NATOCountryCode.xml")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;although this was more of an issue with referencing additional files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. if the path does not exist then split on white space and try again - this can be very hit and miss though&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;path = "c:\data\tools\script.py d:\work\output.pdf"
cleanedPath = path.split(" ")[1]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope some of this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:21:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273585#M21136</guid>
      <dc:creator>DaveBarrett</dc:creator>
      <dc:date>2021-12-11T13:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273586#M21137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When you say the tool won't run (after correcting the path issue), is it that you get the same error, or the tool dialog itself shows an issue (red X)?&lt;BR /&gt;&lt;BR /&gt;If it's the tool dialog, then you might need to adjust how the parameter is set up. If it's set up as a 'file', validation does check if the file exists.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the dialog box I get a red "X", why does the file need to exist beforehand?&amp;nbsp; Okay, I exported a page so I had a pdf file to replace and it worked just fine.&amp;nbsp; Does this seem odd?&amp;nbsp; And I have to browse to the folder and select the file.&amp;nbsp; For some reason, even though the path and file a specified, it won't go unless I manually choose that file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 18:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273586#M21137</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2013-08-20T18:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Access is Denied (os.remove)</title>
      <link>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273587#M21138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In the dialog box I get a red "X", why does the file need to exist beforehand?&amp;nbsp; Okay, I exported a page so I had a pdf file to replace and it worked just fine.&amp;nbsp; Does this seem odd?&amp;nbsp; And I have to browse to the folder and select the file.&amp;nbsp; For some reason, even though the path and file a specified, it won't go unless I manually choose that file.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's just part of the built in validation. There is an option on the parameter to change the Direction to "Output" instead of "Input". Doesn't look like that requires the file to exist, and if it already does, it will ask if you want to overwrite (which I think just sets the environment variable).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 19:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-is-denied-os-remove/m-p/273587#M21138</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2013-08-20T19:45:02Z</dc:date>
    </item>
  </channel>
</rss>

