Skip to content

Commit

Permalink
Improve error message when Windows rejects symlink creation, reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dimo414 committed Nov 19, 2021
1 parent 3370f55 commit 0b1bb36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ struct CacheEntry<K, V> {

// See https://doc.rust-lang.org/std/fs/fn.soft_link.html
#[cfg(windows)]
use std::os::windows::fs::symlink_file as symlink;
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> Result<()> {
std::os::windows::fs::symlink_file(original, link)
.context("Windows prevents most programs from creating symlinks; see https://github.com/dimo414/bkt/issues/3")
}
#[cfg(unix)]
use std::os::unix::fs::symlink;

Expand Down

0 comments on commit 0b1bb36

Please sign in to comment.