broker_tokio/fs/os/unix/symlink.rs
1use crate::fs::asyncify;
2
3use std::io;
4use std::path::Path;
5
6/// Creates a new symbolic link on the filesystem.
7///
8/// The `dst` path will be a symbolic link pointing to the `src` path.
9///
10/// This is an async version of [`std::os::unix::fs::symlink`][std]
11///
12/// [std]: std::os::unix::fs::symlink
13pub async fn symlink(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()> {
14 let src = src.as_ref().to_owned();
15 let dst = dst.as_ref().to_owned();
16
17 asyncify(move || std::os::unix::fs::symlink(src, dst)).await
18}