-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added client methods CreateDirectory() and RemoveDirectory() #4
Conversation
Hi Claudio. Thank you very much for your contribution. Here are some things if like to see.
My goal is to keep the surface area of the api as small as possible. This gives us a better chance of being compatible with tr other FileSystem interfaces.
|
- Renamed CreateDirectory() to MkDir() - Integrated RemoveDirectory() into Remove()
Hi Dave I understand your motivation to want to stay compatible with the other file system interfaces. Actually I myself tried to delete a directory with Remove() first. That's how I became aware that the directory functions had not yet been implemented. So...
Method 1 is safe but slow. Method 2 is slow only when a directory is being removed. Trying I have implemented and committed method 2. What do you think? Regards, |
Thanks, I agree with option 2. I'll review the diff when I get back home this eventing Thanks again
|
Dave, do you have time to provide an update on this review? |
Oh my god, have I really left this open so long. I am so sorry, this is unacceptable. Next 24 hours, I promise. On Sat, Mar 1, 2014 at 11:20 AM, hochhaus notifications@github.com wrote:
|
func (c *Client) Remove(path string) error { | ||
// TODO(dfc) can't handle directories, yet | ||
err := c.removeFile(path) | ||
if status, ok := err.(*StatusError); ok && (status.Code == ssh_FX_FAILURE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for the parens, this isn't C
LGTM. One small nit. I've given you contrib on the repo, please land this when you've addressed the review points. Thanks again Dave |
Added client methods CreateDirectory() and RemoveDirectory()
Hi Dave
I added two methods CreateDirectory() and RemoveDirectory() to your excellent SFTP library. Maybe you want to include my changes.
Regards,
Claudio