Bug 1271 - sftp should allow local files (lrm) and directories (lrmdir) to be removed
Summary: sftp should allow local files (lrm) and directories (lrmdir) to be removed
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 4.3p2
Hardware: Other Linux
: P2 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-29 18:25 AEDT by Matthew Flaschen
Modified: 2008-04-04 09:57 AEDT (History)
0 users

See Also:


Attachments
Adds lrm and lrmdir options to sftp (1.79 KB, patch)
2006-12-29 18:27 AEDT, Matthew Flaschen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Flaschen 2006-12-29 18:25:41 AEDT
I think OpenSSH sftp ought to have lrm and lrmdir commands to remove local files and directories respectively.  This is useful, for instance, when you download files by mistake.  I have implemented those features in the attached patch.

I added the options the in-program "Available commands", but not to the man page.  I couldn't figure out how the documentation worked, so someone else would need to edit it if that patch is accepted.

It has been tested on Kubuntu Edgy GNU/Linux, but I'm fairly sure that patch is portable.
Comment 1 Matthew Flaschen 2006-12-29 18:27:16 AEDT
Created attachment 1223 [details]
Adds lrm and lrmdir options to sftp
Comment 2 Darren Tucker 2006-12-30 16:16:02 AEDT
Any reason you don't just use "!rm filename" or "!rmdir filename" ?
Comment 3 Matthew Flaschen 2006-12-30 17:25:38 AEDT
That works, but shouldn't be necessary for such a common action.  I also think a local rename could be useful.
Comment 4 Darren Tucker 2007-01-19 09:11:39 AEDT
Thanks, but I don't think we need to do this.  Adding extra code to support another way to do something that you can already do (in the same number of keystrokes too) does not seem warranted.
Comment 5 Matthew Flaschen 2007-01-19 10:10:54 AEDT
Fair enough.  I saw it as standardizing the interface, but it certainly isn't necessary.
Comment 6 Damien Miller 2008-04-04 09:57:49 AEDT
Close resolved bugs after release.