[−][src]Struct ssh2::Sftp
A handle to a remote filesystem over SFTP.
Instances are created through the sftp
method on a Session
.
Implementations
impl Sftp
[src]
pub fn open_mode(
&self,
filename: &Path,
flags: OpenFlags,
mode: i32,
open_type: OpenType
) -> Result<File, Error>
[src]
&self,
filename: &Path,
flags: OpenFlags,
mode: i32,
open_type: OpenType
) -> Result<File, Error>
Open a handle to a file.
pub fn open(&self, filename: &Path) -> Result<File, Error>
[src]
Helper to open a file in the Read
mode.
pub fn create(&self, filename: &Path) -> Result<File, Error>
[src]
Helper to create a file in write-only mode with truncation.
pub fn opendir(&self, dirname: &Path) -> Result<File, Error>
[src]
Helper to open a directory for reading its contents.
pub fn readdir(&self, dirname: &Path) -> Result<Vec<(PathBuf, FileStat)>, Error>
[src]
Convenience function to read the files in a directory.
The returned paths are all joined with dirname
when returned, and the
paths .
and ..
are filtered out of the returned list.
pub fn mkdir(&self, filename: &Path, mode: i32) -> Result<(), Error>
[src]
Create a directory on the remote file system.
pub fn rmdir(&self, filename: &Path) -> Result<(), Error>
[src]
Remove a directory from the remote file system.
pub fn stat(&self, filename: &Path) -> Result<FileStat, Error>
[src]
Get the metadata for a file, performed by stat(2)
pub fn lstat(&self, filename: &Path) -> Result<FileStat, Error>
[src]
Get the metadata for a file, performed by lstat(2)
pub fn setstat(&self, filename: &Path, stat: FileStat) -> Result<(), Error>
[src]
Set the metadata for a file.
pub fn symlink(&self, path: &Path, target: &Path) -> Result<(), Error>
[src]
Create a symlink at target
pointing at path
.
pub fn readlink(&self, path: &Path) -> Result<PathBuf, Error>
[src]
Read a symlink at path
.
pub fn realpath(&self, path: &Path) -> Result<PathBuf, Error>
[src]
Resolve the real path for path
.
pub fn rename(
&self,
src: &Path,
dst: &Path,
flags: Option<RenameFlags>
) -> Result<(), Error>
[src]
&self,
src: &Path,
dst: &Path,
flags: Option<RenameFlags>
) -> Result<(), Error>
Rename a filesystem object on the remote filesystem.
The semantics of this command typically include the ability to move a
filesystem object between folders and/or filesystem mounts. If the
Overwrite
flag is not set and the destfile entry already exists, the
operation will fail.
Use of the other flags (Native or Atomic) indicate a preference (but not a requirement) for the remote end to perform an atomic rename operation and/or using native system calls when possible.
If no flags are specified then all flags are used.
pub fn unlink(&self, file: &Path) -> Result<(), Error>
[src]
Remove a file on the remote filesystem
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,