pub struct Sftp { /* private fields */ }
Implementations§
source§impl Sftp
impl Sftp
sourcepub fn create_dir(&self, filename: &str, mode: mode_t) -> SshResult<()>
pub fn create_dir(&self, filename: &str, mode: mode_t) -> SshResult<()>
Create a directory.
mode
specifies the permission bits to use on the directory.
They will be modified by the effective umask on the server.
sourcepub fn canonicalize(&self, filename: &str) -> SshResult<String>
pub fn canonicalize(&self, filename: &str) -> SshResult<String>
Canonicalize filename
, resolving relative directory references
and symlinks.
sourcepub fn chmod(&self, filename: &str, mode: mode_t) -> SshResult<()>
pub fn chmod(&self, filename: &str, mode: mode_t) -> SshResult<()>
Change the permissions of a file
sourcepub fn chown(&self, filename: &str, owner: uid_t, group: gid_t) -> SshResult<()>
pub fn chown(&self, filename: &str, owner: uid_t, group: gid_t) -> SshResult<()>
Change the ownership of a file.
sourcepub fn set_metadata(
&self,
filename: &str,
metadata: &SetAttributes
) -> SshResult<()>
pub fn set_metadata( &self, filename: &str, metadata: &SetAttributes ) -> SshResult<()>
Change certain metadata attributes of the named file.
sourcepub fn metadata(&self, filename: &str) -> SshResult<Metadata>
pub fn metadata(&self, filename: &str) -> SshResult<Metadata>
Retrieve metadata for a file, traversing symlinks
sourcepub fn symlink_metadata(&self, filename: &str) -> SshResult<Metadata>
pub fn symlink_metadata(&self, filename: &str) -> SshResult<Metadata>
Retrieve metadata for a file, without traversing symlinks.
sourcepub fn rename(&self, filename: &str, new_name: &str) -> SshResult<()>
pub fn rename(&self, filename: &str, new_name: &str) -> SshResult<()>
Rename a file from filename
to new_name
sourcepub fn remove_file(&self, filename: &str) -> SshResult<()>
pub fn remove_file(&self, filename: &str) -> SshResult<()>
Remove a file or an empty directory
sourcepub fn remove_dir(&self, filename: &str) -> SshResult<()>
pub fn remove_dir(&self, filename: &str) -> SshResult<()>
Remove an empty directory
sourcepub fn symlink(&self, target: &str, dest: &str) -> SshResult<()>
pub fn symlink(&self, target: &str, dest: &str) -> SshResult<()>
Create a symlink on the server.
target
is the filename of the symlink to be created,
and dest
is the payload of the symlink.
sourcepub fn open(
&self,
filename: &str,
accesstype: c_int,
mode: mode_t
) -> SshResult<SftpFile>
pub fn open( &self, filename: &str, accesstype: c_int, mode: mode_t ) -> SshResult<SftpFile>
Open a file on the server.
accesstype
corresponds to the open(2)
flags
parameter
and controls whether the file is opened for read/write and so on.
mode
specified the permission bits to use when creating a new file;
they will be modified by the effective umask on the server side.