pub fn hide<T: AsRef<Path>>(path: T) -> Result<PathUpdate<T>>
Available on crate feature
fs
only.Expand description
Hides the given path in the current platform’s file explorer.
Platform specific behavior
-
On Unix, this function prefixes the path with a ‘.’ and returns Changed if it does not already have one. If the path already has the prefix, the function returns Unchanged.
-
On Windows, this function calls GetFileAttributesW and SetFileAttributesW with the FILE_ATTRIBUTE_HIDDEN attribute. Because windows uses file attributes to define if a file should be visible, the function always returns Unchanged.
Arguments
path
: the path to convert.
returns: Result<(), Error>
Errors
Returns an Error if the path couldn’t be hidden.