Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Empty folders on FTP sometimes created as 0 byte files - how to find and delete them in folders

It's not possible with simple WinSCP scripting.
But it's easy with WinSCP .NET assembly and PowerShell (or other language of your preference).
Use Session.EnumerateRemoteFiles to list all files and filter those you are interested in.
https://winscp.net/eng/docs/library_session_enumerateremotefiles
waldimort

Empty folders on FTP sometimes created as 0 byte files - how to find and delete them in folders

I have a scheduled script uploading files and folders from my local computer. Sometimes empty folders are created as zero byte files. Found already threads to that topic but my logs were due to age already deleted. Will send it as soon it happen again.
Sadly the 0byte files will not be overwritten. Instead the next time the script runs it simply stumbles exits at that point. In the GUI it is quite convenient to find and delete the Zerobyte files. (mask: <1) How can I do that with script? The RM command seems to not offer options like sizefilter or including subfolders