Sha256: 022c44d2592d8abd9f69eac2598652293020b3272a243ab5a8d3ea7c49531982
Contents?: true
Size: 633 Bytes
Versions: 36
Compression:
Stored size: 633 Bytes
Contents
//! `get_path` translation code for macOS derived from Rust's //! library/std/src/sys/unix/fs.rs at revision //! 108e90ca78f052c0c1c49c42a22c85620be19712. use crate::rustix::fs::file_path_by_ttyname_or_seaching; use rustix::fs::getpath; use std::ffi::OsString; use std::fs; #[cfg(unix)] use std::os::unix::ffi::OsStringExt; #[cfg(target_os = "wasi")] use std::os::wasi::ffi::OsStringExt; use std::path::PathBuf; pub(crate) fn file_path(file: &fs::File) -> Option<PathBuf> { if let Ok(path) = getpath(file) { return Some(OsString::from_vec(path.into_bytes()).into()); } file_path_by_ttyname_or_seaching(file) }
Version data entries
36 entries across 36 versions & 1 rubygems