1use crate::fs::asyncify;
2
3use std::fs::Permissions;
4use std::io;
5use std::path::Path;
6
7/// Changes the permissions found on a file or a directory.
8///
9/// This is an async version of [`std::fs::set_permissions`][std]
10///
11/// [std]: fn@std::fs::set_permissions
12pub async fn set_permissions(path: impl AsRef<Path>, perm: Permissions) -> io::Result<()> {
13 let path = path.as_ref().to_owned();
14 asyncify(|| std::fs::set_permissions(path, perm)).await
15}
16