Get filenames in folder
-
I use the two FileDetector methods (via node-red and DoWhile) both work very well. However I want to get the names of the files inside a folder. Can you give me the path of the stones (how to do it?);)
-
I'm not sure if your asking how to get the the path of the item that trigger the detector, or asking in general how to get the names of all files in a folder ?
If the first, useSystem.IO.Path.GetDirectoryName("c:\temp\findme.txt")
If you want to get all files inside a folder, use
System.IO.Directory.GetFiles("c:\temp")
( Use For Each With Body Factory with type set to string to loop it )
That will return an array of full path and filename, so if you then only want the file name, useSystem.IO.Path.GetFileName(item)
-
@allan-zimmermann
Yes, it was the second option, but all the other options served me.
Thanks again.