Hello,
I'm using Directory_GetSubDirectories to get the whole list of directories.
Then I iterate that list and on each iteration I use Directory_ListDirFiles (with SearchSubDir = True) to get all of the files inside on each directory and sub directory - and I do my business logic.
The problem that I'm having is that the action Directory_ListDirFiles doesn't retrieve me the whole list of files (most of the times it stops at 50 length), and I have more than 50.
Can you help? This puts in jeopardy a huge part of the project.
Thank you so much
Looking at the C# code, I'm not sure if the "SearchSubDir" is working. The files that you're not getting belong to a sub-directory?
EDIT: Looking to other action in that extension (Directory_SearchFiles), I think this implementation is better than the one that you're using. In the parameter "SearchPattern" you can pass "*.*". Can you test?
Hi Diogo.
Are you using a For Each element right? That element has the properties "Start Index" and "Maximum Iterations". Do you have those properties filled in? Try remove them so it iterates through all records. The only mandatory property is "Record List".
If my previous tip doesn't work, you can also verify inside the extension what's being doing in the action "Directory_ListDirFiles".
Hope it helps.
Hello Miguel!
No, I don't have the properties "Start Index" and "Maximum Iterations" filled in.
I'm not and expert on C#, but let's see.
I'm still hoping that someone knows a solution (fingers crossed).
Can you please share the module and the extension so I can see?
The extension is this forge component: FileSystem - Overview (O11) | OutSystems
The module unfortunately I cannot share because it contains client's information. But I will attach an image with generic names to show you the workflow.
Yes. But I'm getting subdirectories, just not everything. I'm just getting some sub directories, that's what's weird.
Edit: Implemented it and tested it. It comes back empty :( Edit2: MIGUEL!!! It's working!!! hahaha, thank you so so much! Can you explain why this SearchFiles is working and the ListDirFiles wasn't ?
I'm glad I helped you. :)
The implementation in the extension is different, with regards to the parameter "SearchSubDir". In my opinion the Directory_SearchFiles is better implemented because it's using an option developed in the .NET itself.
Directory_ListDirFiles
if (ssSearchSubDir == true) ssFileList = ProduceListing(di.FullName, di, ssFileList);
Directory_SearchFiles
if (ssSearchSubDir) sOpts = SearchOption.AllDirectories;
@João Portela I would like to suggest to revisit the Forge Component so we can use the same "SearchOption.AllDirectories" in the action "Directory_ListDirFiles" as well. :)