<?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 Really strange issue - os.listdir in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158173#M4146</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you kindly look at the below, I have a really weird one where I am referencing a location within my files area of a Lakehouse however&amp;nbsp;&lt;STRONG&gt;sporadically&lt;/STRONG&gt; it does not work, I have no idea why either, as it is so simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JP8991_0-1726709894826.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1169683i4A6FC9F5D4DBB7D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JP8991_0-1726709894826.png" alt="JP8991_0-1726709894826.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 01:38:23 GMT</pubDate>
    <dc:creator>JP8991</dc:creator>
    <dc:date>2024-09-19T01:38:23Z</dc:date>
    <item>
      <title>Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158173#M4146</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you kindly look at the below, I have a really weird one where I am referencing a location within my files area of a Lakehouse however&amp;nbsp;&lt;STRONG&gt;sporadically&lt;/STRONG&gt; it does not work, I have no idea why either, as it is so simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JP8991_0-1726709894826.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1169683i4A6FC9F5D4DBB7D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JP8991_0-1726709894826.png" alt="JP8991_0-1726709894826.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 01:38:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158173#M4146</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-09-19T01:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158401#M4148</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/134970"&gt;@JP8991&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When referencing files in the lakehouse Files folder, you do not need to prefix them with /lakehouse/dafault.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown below, I have a 2019.csv file in the orders directory under the Files folder. When I reference it in the notebook, the path is as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_0-1726713355378.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1169736iDAD1B04E7C988D4A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_0-1726713355378.png" alt="vhuijieymsft_0-1726713355378.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 02:36:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158401#M4148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-19T02:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158437#M4149</link>
      <description>&lt;P&gt;For the use case I need it for, which is to list what files are listed in a directory, I do not think this is correct.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JP8991_1-1726714128577.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1169758i0EC56CF9750B460E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JP8991_1-1726714128577.png" alt="JP8991_1-1726714128577.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 02:48:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4158437#M4149</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-09-19T02:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4160968#M4164</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/134970"&gt;@JP8991&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use this code to list the directories in the Files folder:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import os

# set folder path
folder_path = "/lakehouse/default/Files/"

# list directory
try:
    directories = [d for d in os.listdir(folder_path) if os.path.isdir(os.path.join(folder_path, d))]
    # print list
    for directory in directories:
        print(directory)
except FileNotFoundError:
    print(f"The directory {folder_path} does not exist.")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_0-1726799170850.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1170429i802E0AF15B122890/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_0-1726799170850.png" alt="vhuijieymsft_0-1726799170850.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use this code to list the directories in the subfolder orders under the Files folder:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import os

# set folder path
folder_path = "/lakehouse/default/Files/orders/"

# list directory
try:
    directories = [d for d in os.listdir(folder_path) if os.path.isdir(os.path.join(folder_path, d))]
    # print list
    for directory in directories:
        print(directory)
except FileNotFoundError:
    print(f"The directory {folder_path} does not exist.")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhuijieymsft_1-1726799170853.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1170428iB88394B18FCB619F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vhuijieymsft_1-1726799170853.png" alt="vhuijieymsft_1-1726799170853.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They all work well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 02:27:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4160968#M4164</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-20T02:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4164459#M4190</link>
      <description>&lt;P&gt;Is Xplor a file or directory?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Xplor is a file, not a directory, then I guess the error message you're seeing makes sense.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 00:48:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4164459#M4190</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-09-22T00:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4165420#M4199</link>
      <description>&lt;P&gt;I genuinely think there is some sort of bug.&lt;BR /&gt;&lt;BR /&gt;I ran your code and this was my outcome:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JP8991_0-1727047539710.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1171309iDD9793A052AC9E7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JP8991_0-1727047539710.png" alt="JP8991_0-1727047539710.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I then ran the code three minutes later and this was my outcome which is exactly as expected:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JP8991_1-1727047702066.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1171310iF977204DD0B3FA9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JP8991_1-1727047702066.png" alt="JP8991_1-1727047702066.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 23:28:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4165420#M4199</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-09-22T23:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4165422#M4200</link>
      <description>&lt;P&gt;Xplor is a directory.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2024 23:29:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4165422#M4200</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-09-22T23:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4232469#M4476</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;whilst this seems to be working now on my end I don't think any of these are the solution so it does not make sense to mark them as such.&lt;BR /&gt;&lt;BR /&gt;Anyone looking at this in the future will not have the correct answer.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 20:59:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4232469#M4476</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-10-07T20:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4246349#M4664</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got the same issue:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjam0410_0-1729158367309.png" style="width: 677px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184701i3CC4657D11E667B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjam0410_0-1729158367309.png" alt="mjam0410_0-1729158367309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When listing "Files", the folder "rawdev" is shown correctly&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjam0410_1-1729158482404.png" style="width: 679px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184702iDFC2D464A844FDCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjam0410_1-1729158482404.png" alt="mjam0410_1-1729158482404.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Some minutes later, listing the content of the specified folder works...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjam0410_2-1729158595527.png" style="width: 679px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184703i8D5AB794818EDA21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjam0410_2-1729158595527.png" alt="mjam0410_2-1729158595527.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 09:51:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4246349#M4664</guid>
      <dc:creator>mjam0410</dc:creator>
      <dc:date>2024-10-17T09:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4249706#M4695</link>
      <description>&lt;P&gt;This is really frustrating that no one at MS seems to be listening here.&lt;BR /&gt;&lt;BR /&gt;My pipeline failed again this morning due to this problem and I have to manually go in and keep refreshing the particular notebook that is affected until it works.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2024 20:29:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4249706#M4695</guid>
      <dc:creator>JP8991</dc:creator>
      <dc:date>2024-10-20T20:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4249733#M4696</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I suggest creating a support ticket to raise the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried Notebookutils File System Utilities btw?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#file-system-utilities" target="_blank"&gt;https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#file-system-utilities&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't tried it myself but perhaps that is an option.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2024 23:16:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4249733#M4696</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-10-20T23:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4271468#M5013</link>
      <description>&lt;P&gt;I am attempting the same thing and used the code above and am getting the same response "&lt;SPAN&gt;The directory **** does not exist.&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 22:56:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4271468#M5013</guid>
      <dc:creator>frankmroberts</dc:creator>
      <dc:date>2024-11-05T22:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4278741#M5125</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also getting some of the same issues as you are decribing here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I found out that when working with &lt;STRONG&gt;os&lt;/STRONG&gt; module and absolute paths(eg: '/lakehouse/default/Files') like 'os.listdir' these exceptions usually occur after uploading some files/folder while running a session with default lakehouse.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;What I imagine the issue is that fabric filesystem runs on top of blobfuse2 and the change you do is not imediately reflected to the users mounted filesystem under /lakehouse/default/Files.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The workaround is to use notebookutils.fs module to list dir since this module reflects the changes imediatelly somehow. You can also use this module to read the file content for example:&amp;nbsp;&lt;STRONG&gt;notebookutils.fs.head('Files/filetoread.txt', maxBytes=10000)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or to list files under files directory:&amp;nbsp;&lt;STRONG&gt;notebookutils.fs.ls('Files/')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still I think this is a bug so the microsoft team should address it.&lt;/P&gt;&lt;P&gt;Hope it helps someone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 21:42:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4278741#M5125</guid>
      <dc:creator>gregahren</dc:creator>
      <dc:date>2024-11-11T21:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Really strange issue - os.listdir</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4394776#M6925</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In this example, I use the notebookutils to loop through the files in a dir and get only the name without the extension.&lt;BR /&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; notebookutils.fs &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; ls&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;application_path = &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;'abfss://#########@onelake.dfs.fabric.microsoft.com/000000000000/Files/folder/'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;files_list = []&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;file&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; ls(os.path.join(application_path,&lt;/SPAN&gt;&lt;SPAN&gt;'excel_files_from_anp'&lt;/SPAN&gt;&lt;SPAN&gt;)):&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_name = &lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;.name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; file_name.endswith(&lt;/SPAN&gt;&lt;SPAN&gt;'.xlsx'&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_list.append(file_name.split(&lt;/SPAN&gt;&lt;SPAN&gt;'.'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;BR /&gt;&lt;BR /&gt;for some reason os.listdir doesn't&amp;nbsp;work in a pipeline or with abfss path.&lt;BR /&gt;Also ls is not allowed to return or anything or become an object.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print the dir of file and you will see some properties like name, size...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Feb 2025 15:46:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Really-strange-issue-os-listdir/m-p/4394776#M6925</guid>
      <dc:creator>Brunovs79_cimen</dc:creator>
      <dc:date>2025-02-04T15:46:18Z</dc:date>
    </item>
  </channel>
</rss>

