<?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: how to delete a folder in databricks mnt? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29477#M21203</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;use this (last raw should not be indented twice...):&lt;/P&gt;
&lt;P&gt;def delete_mounted_dir(dirname): &lt;/P&gt;
&lt;P&gt;files=dbutils.fs.ls(dirname) &lt;/P&gt;
&lt;P&gt; for f in files: &lt;/P&gt;
&lt;P&gt;if f.isDir(): &lt;/P&gt;
&lt;P&gt; delete_mounted_dir(f.path) &lt;/P&gt;
&lt;P&gt;dbutils.fs.rm(f.path, recurse=True)&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 08:16:10 GMT</pubDate>
    <dc:creator>amitca71</dc:creator>
    <dc:date>2020-11-30T08:16:10Z</dc:date>
    <item>
      <title>how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29469#M21195</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have a folder at location dbfs:/mnt/temp&lt;/P&gt;
&lt;P&gt;I need to delete this folder. I tried using &lt;/P&gt;
&lt;P&gt;%fs rm mnt/temp&lt;/P&gt;
&lt;P&gt;&amp;amp; &lt;/P&gt;
&lt;P&gt;dbutils.fs.rm("mnt/temp")&lt;/P&gt;
&lt;P&gt;Could you please help me out with what I am doing wrong?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 11:53:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29469#M21195</guid>
      <dc:creator>nmud19</dc:creator>
      <dc:date>2016-09-08T11:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29470#M21196</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi nmud19,&lt;/P&gt;
&lt;P&gt;What error did you get? Can you paste a stack trace? &lt;/P&gt;
&lt;P&gt;You may need to make the path absolute and set recursive to true.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.rm("/mnt/temp", true)&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 16:29:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29470#M21196</guid>
      <dc:creator>rlgarris</dc:creator>
      <dc:date>2016-09-09T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29471#M21197</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Or, to be more readable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.rm(fileprefix+".tmp",recurse=true)&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 21:38:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29471#M21197</guid>
      <dc:creator>JosiahYoder</dc:creator>
      <dc:date>2017-07-27T21:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29472#M21198</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.rm("/mnt/temp",True)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The command above works in runtime 5.1 with python3&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:33:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29472#M21198</guid>
      <dc:creator>rockssk</dc:creator>
      <dc:date>2019-02-14T18:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29473#M21199</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Since you're deleting a folder in the &lt;PRE&gt;&lt;CODE&gt;/mnt&lt;/CODE&gt;&lt;/PRE&gt; directory, I assume it was made when you mounted a data source. If that's the case, you can delete the folder using &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.unmount("/mnt/temp/")&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 23:15:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29473#M21199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-07T23:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29474#M21200</link>
      <description>&lt;P&gt;I found the easier way out. It was getting this error all the time: TypeError: '/mnt/adls2/demo/target/' has the wrong type - class bool is expected. Googling helped a lot &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Remove files from directory after uploading in Databricks using research paper help in copying files using dbutils&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 08:18:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29474#M21200</guid>
      <dc:creator>StefanAlbrecht</dc:creator>
      <dc:date>2019-07-23T08:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29475#M21201</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;try LongPathTool program&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 12:28:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29475#M21201</guid>
      <dc:creator>RoyLiga</dc:creator>
      <dc:date>2019-12-08T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29476#M21202</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;how do I delete multiple folders within a mount point ???&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 16:15:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29476#M21202</guid>
      <dc:creator>SaipradeepSaipr</dc:creator>
      <dc:date>2020-10-28T16:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete a folder in databricks mnt?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29477#M21203</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;use this (last raw should not be indented twice...):&lt;/P&gt;
&lt;P&gt;def delete_mounted_dir(dirname): &lt;/P&gt;
&lt;P&gt;files=dbutils.fs.ls(dirname) &lt;/P&gt;
&lt;P&gt; for f in files: &lt;/P&gt;
&lt;P&gt;if f.isDir(): &lt;/P&gt;
&lt;P&gt; delete_mounted_dir(f.path) &lt;/P&gt;
&lt;P&gt;dbutils.fs.rm(f.path, recurse=True)&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 08:16:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-delete-a-folder-in-databricks-mnt/m-p/29477#M21203</guid>
      <dc:creator>amitca71</dc:creator>
      <dc:date>2020-11-30T08:16:10Z</dc:date>
    </item>
  </channel>
</rss>

