#longer #maintained #symlink #file #traits #symbolic #link

yanked nofollow

This crate is no longer maintained

0.1.4 Jun 11, 2021
0.1.3 May 7, 2021
0.1.2 Apr 13, 2021
0.1.1 Mar 2, 2021
0.1.0 Mar 1, 2021

#48 in #symlink

40 downloads per month

MPL-2.0 license

8KB
86 lines

This project is no longer maintained.


lib.rs:

This crate provide an extension trait for OpenOptions to prevent dereferencing if the given path is a symbolic link when opening a file.

use nofollow::OpenOptionsExt;
use std::{fs::OpenOptions, io::prelude::*};

let mut content = String::new();
OpenOptions::new()
    .read(true)
    .no_follow()
    .open(file!())
    .unwrap()
    .read_to_string(&mut content)
    .unwrap();
assert_eq!(content, include_str!(concat!("../", file!())));

Dependencies

~42KB