<?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 List all files in a directory with 50000+ files in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/list-all-files-in-a-directory-with-50000-files/m-p/284609#M237739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to know how to list all files in a directory with a large amount of files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ive tried with a webscript like this one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; &lt;BR /&gt;var node= companyhome.childByNamePath("XXX");&lt;BR /&gt;&lt;BR /&gt;var nodos=node.children;&lt;BR /&gt;var numBonosTotal=nodos.length;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that every time i execute it, it ends with a number really different. One time is 27k, another 17k another 50k.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to know how much files are really? and after that list them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any Idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thankyou&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 10:13:51 GMT</pubDate>
    <dc:creator>neo6200</dc:creator>
    <dc:date>2015-06-12T10:13:51Z</dc:date>
    <item>
      <title>List all files in a directory with 50000+ files</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/list-all-files-in-a-directory-with-50000-files/m-p/284609#M237739</link>
      <description>I would like to know how to list all files in a directory with a large amount of files.Ive tried with a webscript like this one. var node= companyhome.childByNamePath("XXX");var nodos=node.children;var numBonosTotal=nodos.length;‍‍‍‍‍‍‍The problem is that every time i execute it, it ends with a numb</description>
      <pubDate>Fri, 12 Jun 2015 10:13:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/list-all-files-in-a-directory-with-50000-files/m-p/284609#M237739</guid>
      <dc:creator>neo6200</dc:creator>
      <dc:date>2015-06-12T10:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: List all files in a directory with 50000+ files</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/list-all-files-in-a-directory-with-50000-files/m-p/284610#M237740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One option you can try is - run the code with system user. It should get you the correct results each time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like you are using a JavaScript based web script, in which you will not get the apis to run a particular code block with system user. You will need to create a custom JavaScript extension for that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you would be having a Java backed web script, you could directly use method from AuthenticationUtil to run as a &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;system user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you can write a database query for this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 14:20:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/list-all-files-in-a-directory-with-50000-files/m-p/284610#M237740</guid>
      <dc:creator>romschn</dc:creator>
      <dc:date>2015-06-12T14:20:00Z</dc:date>
    </item>
  </channel>
</rss>

