Counting #Files in local directory

Is there an easy way to count the number of files in a local directory (desktop version)?

Use case - I have an FTP action that downloads all the files from an FTP server BUT sometimes there are no files produced on the FTP server. Rather than proceed through the workflow, I’d like to produce an error when no files (Count = 0) are downloaded. Another use would be knowing whether to use or not use “Iterate” on some folder depending on whether there are files present.

Any advice would be greatly appreciated.
thank you

Hi @LJMiller,

Check out this topic: Filter files in SFTP action

Hello Dmitry - I saw this article but was hoping to check on the desktop-side (not on the sFTP site) because the host of the sFTP site makes it very difficult to pass any commands along. Any other thoughts on “counting files” on the desktop-side?

thank you

In a local folder you can use the “List files” action, and then “Table metadata” or “Aggregate” to count the number of files in the list.