Topic "-filemask for rm & rmdir"

Author Message
Pavel

Guest


Hi!
Scripting functionality will be more complete if you add an -filemask option for rm and rmdir commands.
Thanks in advance!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
You can do rm <mask>.
https://winscp.net/eng/docs/scriptcommand_rm

What is your use case?
Pavel

Guest


I need something like rm *.7z<2016-10-28
Pavel

Guest


Pavel wrote:
I need something like rm *.7z<2016-10-28

...and it works!
Ok, and how to work with directories?
This is fails: rmdir *<2016-10-28
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
The rmdir does not support masks. But you can use the rm to delete directories too.
_________________
Martin Prikryl
pavel

Guest


Does rm supports a directory mask?
Something like rm */<2016-01-01 (this comman fails)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26572
Location: Prague, Czechia
No the */ has different semantics here, than in a file mask.

But */<2016-01-01 works and will delete even the old folders (but files too).
Pavel

Guest


Ok, I see two ways: first is to add a full support for a directory mask semantic in rm command, or second is to add a masks support for rmdir. The first in my opinion is more correctly, and the rmdir command is redundant.
Advertisements

You can post new topics in this forum






Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License