Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Darrell Harr
2
Views
10
Comments
using "Directory_ListDirFiles"
Question
I have a folder X with many subfolders and files... there are so many files that the call to "Directory_ListDirFiles" with the 'showSubFolders' set to 'true' returns everything.
Whe I call "Directory_ListDirFiles" with 'ShowSubFolders' set to 'false' I get nothing returned because there are no files in folder X?? What I need is for the call to "Directory_ListDirFiles" to return the folders in the list... so..
if there are no files in X but 20 folders the list would include the 20 subfolders and/or the 20 subfolders and the files in the X folder... ???
If I'm doing something incorrect or if there is a version that does this... please Advise...
Carla Ribeiro da Fonseca
Did you give access to the folder to the "user" that is running the IIS Worker Process (w3wp.exe) on the server?
Getting the right one can be tricky...
Nuno Reis
MVP
Hi.
If it only works with subFolders=True, I think you are in the folder above X.
Darrell Harr
yes I know ... it only works with subFolders= True... but that returns all subfolders....
It seems the call to
"Directory_ListDirFiles"
with subfolders = False .....
should return any files in the directory passed and also the folders in that directory...
that way you could continue to drill down ... on the listed folders.... (in the code of course)... but the way it works is I don't get a list of folders in the current folder... unless I set subfolders=true and then I get everything... ie.. all nested subfolders... which in my case can be 10's of thousands of files as you go down the chain???
Darrell Harr
here's an example.....
folder-x
folder-a
folder-b
folder-c
folder-d
textfile.txt
if I call
"Directory_ListDirFiles" on folder-x with subfolders=False I would expect it to return me.....
folder-a
folder-b
textfile.txt
what it returns is just textfile.txt???
Nuno Reis
MVP
I'm afraid you don't have it that simple. What you have is Directory_Exists and File_Exists to validate the format of any of the returning names.
Kilian Hekhuis
MVP
"Directory_ListDirFiles" will return files only, not directories. It even says so right in the description ("Returns a list of files in a given directory and if desired, in its sub-directories"). In an older version of the FileSystem extension, there was a "Directory_ListSubDirs" that does what you want, but for some reason it was removed in later versions. If you are familiar with extensions and Integration Studio, you can add it yourself (or create a new extension). I've added the source. The only thing you need to add to the extension (besides the code) is a structure called Directory, with one Text field, DirName.
Directory_ListSubDirs.cs
Darrell Harr
thanks... thats what I needed....
Darrell Harr
Killan.....
question.. how do you define the recordlist ie... 'RLDirectoryRecordList' and the 'RCDirectoryRecord' types
Darrell Harr
I've created the Action in the C# code... but it seems when I use "public void xxxxx" the import function in Integration studio doesn't fine the Action???
How do I get this function to list in Integration Studio???
Kilian Hekhuis
MVP
You must first define the action in Integration Studio, before pasting the C# code, with the same interface as the C# function. Then use "update source" so it will create it in the .cs file, then modify that function based on the code I provided. The recordlist should be defined as I said. If you like I can post some more instructions, but that'll have to wait until after the weekend.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...