shell_rs/
ln.rs

1// Copyright (c) 2021 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
2// Use of this source is governed by Apache-2.0 License that can be found
3// in the LICENSE file.
4
5#[derive(Debug, Clone, Copy)]
6pub struct Options {
7    /// Allow the superuser to attempt to hard link directories
8    /// (note: will probably fail due to system restrictions, even for the  supe‐ruser).
9    pub directory: bool,
10
11    /// Remove existing destination files.
12    pub force: bool,
13
14    /// Dereference TARGETs that are symbolic links.
15    pub logical: bool,
16
17    /// Treat LINK_NAME as a normal file if it is a symbolic link to a directory.
18    pub no_dereference: bool,
19
20    /// Make hard links directly to symbolic links.
21    pub physical: bool,
22
23    /// Create symbolic links relative to link location.
24    pub symbolic: bool,
25}
26
27impl Default for Options {
28    fn default() -> Self {
29        Self {
30            directory: false,
31            force: false,
32            logical: false,
33            no_dereference: false,
34            physical: false,
35            symbolic: false,
36        }
37    }
38}
39
40/// Make links between files.
41pub fn ln() {}