use crate::io;
use crate::path::Path;
use crate::task::spawn_blocking;
pub async fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
let src = src.as_ref().to_owned();
let dst = dst.as_ref().to_owned();
spawn_blocking(move || std::os::unix::fs::symlink(&src, &dst)).await
}
cfg_not_docs! {
pub use std::os::unix::fs::{DirBuilderExt, DirEntryExt, OpenOptionsExt};
}
cfg_docs! {
pub trait DirBuilderExt {
fn mode(&mut self, mode: u32) -> &mut Self;
}
pub trait DirEntryExt {
fn ino(&self) -> u64;
}
pub trait OpenOptionsExt {
fn mode(&mut self, mode: u32) -> &mut Self;
fn custom_flags(&mut self, flags: i32) -> &mut Self;
}
}