0.1.4 |
|
---|---|
0.1.3 |
|
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#44 in #longer
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
~44KB