Sha256: f1f8730a3dff9837783b0c985d253919a34798b6f04319cf7cb885c350364b83
Contents?: true
Size: 852 Bytes
Versions: 20
Compression:
Stored size: 852 Bytes
Contents
use crate::fs::{open, AccessType, FollowSymlinks, OpenOptions}; use std::path::Path; use std::{fs, io}; /// *Unsandboxed* function similar to `access`, but which does not perform /// sandboxing. pub(crate) fn access_unchecked( start: &fs::File, path: &Path, type_: AccessType, follow: FollowSymlinks, ) -> io::Result<()> { let mut options = OpenOptions::new(); options.follow(follow); match type_ { AccessType::Exists => { options.read(true); } AccessType::Access(modes) => { if modes.readable { options.read(true); } if modes.writable { options.write(true); } if modes.executable { options.read(true); } } } open(start, path, &options).map(|_| ()) }
Version data entries
20 entries across 20 versions & 1 rubygems