mattnenterprise / rust-ftp

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

list method return "stream did not contain valid UTF-8" #117

Open llvvrui opened 1 year ago

llvvrui commented 1 year ago

I use from_utf8_lossy method read u8 array buffer,look 1

qy513314 commented 1 year ago

I'm having the same issue version = 3.0.1 image image

EternalNight996 commented 8 months ago

I'm having the same issue;

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(())
}

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 error Command failed with exit code 101.