pkg / sftp

SFTP support for the go.crypto/ssh package
BSD 2-Clause "Simplified" License
1.5k stars 380 forks source link

Add Client.OpenFileWithMode #484

Closed greatroar closed 2 years ago

greatroar commented 2 years ago

This allows creating a file with specific permissions. Fixes #335.

The name of the new method is the one suggested by @puellanivis over at #335.

It's tempting to immediately declare os.OpenFile deprecated, but there may be a reason to keep it indefinitely: the protocol apparently allows opening a file with or without a mode, letting the server determine the mode in the former case.