mattnenterprise / rust-ftp

FTP client for Rust
Apache License 2.0
182 stars 57 forks source link

"stream did not contain valid UTF-8" #120

Open EternalNight996 opened 8 months ago

EternalNight996 commented 8 months ago

Example

use e_services::ftp::Ftp;
fn test() -> Result<()> {
  let mut ftp = Ftp::connect(FtpInfo {
    host: "192.168.127.7",
    uname: "ftpdata",
    passwd: "F%0D@ta",
    port: 21,
  })?;
  ftp.login()?;
  let pwd = ftp.pwd()?;
  println!("pwd {pwd:?}");
  // let list = ftp.list(Some("/"))?;
  // println!("list {list:?}");
  let nlst = ftp.nlst(None)?;
  println!("nlst {nlst:?}");
  Ok(())
}

Error

pwd "/"
thread 'main' panicked at e-services\src\ftp\mod.rs:120:32:
called `Result::unwrap()` on an `Err` value: ConnectionError(Error { kind: InvalidData, message: "stream did not contain valid UTF-8" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[0326/110702.005:ERROR:window_impl.cc(120)] Failed to unregister class Chrome_WidgetWin_0. Error = 0