1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! Cross-platform symbolic link unified interface module
//!
//! This module provides a cross-platform interface for symbolic link operations:
//! - Windows: Uses junction points for directory links (internal implementation).
//! - Unix: Uses symbolic links.
//!
//! The unified API allows higher-level code to be platform-agnostic.
//! All operations are attempted only once; on failure, a detailed error is returned directly
//! without retries, ensuring transparent error propagation to the user.
use junction;
/// Creates a directory symbolic link cross-platform (junction on Windows, symlink on Unix)
///
/// # Arguments
/// * `from` - The target path the link points to
/// * `to` - The path of the link to be created
///
/// # Errors
/// Returns an error if the link cannot be created.
/// Creates a directory symbolic link cross-platform (junction on Windows, symlink on Unix)
///
/// # Arguments
/// * `from` - The target path the link points to
/// * `to` - The path of the link to be created
///
/// # Errors
/// Returns an error if the link cannot be created.
/// Deletes a directory symbolic link cross-platform
///
/// # Arguments
/// * `path` - The path of the link to be deleted
///
/// # Errors
/// Returns an error if the link cannot be deleted.
/// Deletes a directory symbolic link cross-platform
///
/// # Arguments
/// * `path` - The path of the link to be deleted
///
/// # Errors
/// Returns an error if the link cannot be deleted.
/// Reads the target of a symbolic link (cross-platform)
///
/// # Arguments
/// * `path` - The symbolic link path
///
/// # Returns
/// The target path the link points to
///
/// # Errors
/// Returns an error if the path is not a symbolic link or cannot be read.
/// Reads the target of a symbolic link (cross-platform)
///
/// # Arguments
/// * `path` - The symbolic link path
///
/// # Returns
/// The target path the link points to
///
/// # Errors
/// Returns an error if the path is not a symbolic link or cannot be read.
/// Checks if a path is a symbolic link/junction
///
/// # Arguments
/// * `path` - The path to check