Closed
Description
- Create a filename on an NTFS partition with a name > 255 bytes, e.g.
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
. - Run this code with the path to the directory containing the file with the very long filename:
use std::env;
use std::fs::{self, ReadDir};
fn main() {
test().unwrap();
}
fn test() -> std::io::Result<ReadDir> {
let args: Vec<String> = env::args().collect();
for result in fs::read_dir(&args[1])? {
result.map(|entry| entry.path()).unwrap();
}
todo!()
}
I expected to see this happen: the code works until it panics on todo!()
Instead, this happened: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 0, kind: Other, message: "Success" }', test.rs:11:42
. Note that in exa, it fails with Bad address (os error 14)
.
Meta
rustc --version --verbose
:
rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: x86_64-unknown-linux-gnu
release: 1.53.0
LLVM version: 12.0.1