/// Again assuming this file is a symlink, follows that link and returns
/// the result of following it.
///
/// For a working symlink that the user is allowed to follow,
/// this will be the `File` object at the other end, which can then have
/// its name, colour, and other details read.
///
/// For a broken symlink, returns where the file *would* be, if it
/// existed. If this file cannot be read at all, returns the error that
/// we got when we tried to read it.
Again assuming this file is a symlink, follows that link and returns
the result of following it.

For a working symlink that the user is allowed to follow,
this will be the `File` object at the other end, which can then have
its name, colour, and other details read.

For a broken symlink, returns where the file *would* be, if it
existed. If this file cannot be read at all, returns the error that
we got when we tried to read it.
Again assuming this file is a symlink follows that link and returns the result of following it . For a working symlink that the user is allowed to follow this will be the ` File ` object at the other end which can then have its name colour and other details read . For a broken symlink returns where the file * would * be if it existed . If this file cannot be read at all returns the error that we got when we tried to read it .
pub fn link_target(&self) -> FileTarget<'dir> {
        // We need to be careful to treat the path actually pointed to by
        // this file — which could be absolute or relative — to the path
        // we actually look up and turn into a `File` — which needs to be
        // absolute to be accessible from any directory.
        debug!("Reading link {:?}", &self.path);
        let path = match fs::read_link(&self.path) {
            Ok(p)   => p,
            Err(e)  => return FileTarget::Err(e),
        };
        let absolute_path = self.reorient_target_path(&path);
        // Use plain `metadata` instead of `symlink_metadata` - we *want* to
        // follow links.
        match fs::metadata(&absolute_path) {
            Ok(metadata) => {
                let ext  = File::ext(&path);
                let name = File::filename(&path);
                FileTarget::Ok(File { parent_dir: None, path, ext, metadata, name })
            }
            Err(e) => {
                error!("Error following link {:?}: {:#?}", &path, e);
                FileTarget::Broken(path)
            }
        }
    }
pub fn link_target ( & self ) -> FileTarget < ' dir > { // We need to be careful to treat the path actually pointed to by // this file — which could be absolute or relative — to the path // we actually look up and turn into a `File` — which needs to be // absolute to be accessible from any directory. debug ! ( " " self path ) ; let path = match fs :: read_link ( & self . path ) { Ok ( p ) => p , Err ( e ) => return FileTarget :: Err ( e ) , } ; let absolute_path = self . reorient_target_path ( & path ) ; // Use plain `metadata` instead of `symlink_metadata` - we *want* to // follow links. match fs :: metadata ( & absolute_path ) { Ok ( metadata ) => { let ext = File :: ext ( & path ) ; let name = File :: filename ( & path ) ; FileTarget :: Ok ( File { parent_dir : None , path , ext , metadata , name } ) } Err ( e ) => { error ! ( " " path e ) ; FileTarget :: Broken ( path ) } } }
Again assuming this file is a symlink, follows that link and returns
the result of following it.
Again assuming this file is a symlink follows that link and returns the result of following it .
&self