-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚚 Move some cli private fs utilities to pna public api
- Loading branch information
Showing
3 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::path::Path; | ||
use std::{io, os}; | ||
|
||
#[cfg(unix)] | ||
#[inline] | ||
pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> { | ||
os::unix::fs::symlink(original, link) | ||
} | ||
|
||
#[cfg(windows)] | ||
#[inline] | ||
pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> { | ||
let original = original.as_ref(); | ||
if original.is_dir() { | ||
os::windows::fs::symlink_dir(original, link) | ||
} else { | ||
os::windows::fs::symlink_file(original, link) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod fs; | ||
|
||
pub use libpna::*; | ||
#[cfg(feature = "portable-network-archive")] | ||
pub use portable_network_archive::*; |