You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "John George (JIRA)" <ji...@apache.org> on 2011/04/20 22:48:05 UTC
[jira] [Commented] (HDFS-1788) FsShell ls: Show symlinks properties
[ https://issues.apache.org/jira/browse/HDFS-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022362#comment-13022362 ]
John George commented on HDFS-1788:
-----------------------------------
To me it looks like this bug has two parts:
1. The ability for FsShell to show a symlink as "l" with the link target "link -> <target>" just like in Linux. This seems to be a straight forward change in FsShell.
2. Inorder for FsShell to be able to do this, it needs to know that it is dealing with a symlink. As of now, it looks like FsShell uses FileSystem to check if a given path is a symlink or not. FileSystem class does not entirely support symlink. So, inorder to fix this bug, ls (FsShell) should either
a) start using FileContext (HADOOP-6424) or
b) FileSystem should be fixed to be able to deal with symlink.
Inorder for FileSystem to support symlink, it should either be able to implement getFileLinkStatus() or getFileStatus() should itself be able to handle symlinks. The fastest/easiest way seems like getting getFileStatus() to also return the FileStatus of links. The best solution (but not the fastest) though seems to be to let FsShell use FileContext. Would it even make sense to let getFileStatus() return the status of symlinks as well (incase where the underlying filesystem supports symlinks) so that ls or any other command that uses FileSystem (as of today) can also deal with symlinks?
Comments and suggestions welcome.
> FsShell ls: Show symlinks properties
> ------------------------------------
>
> Key: HDFS-1788
> URL: https://issues.apache.org/jira/browse/HDFS-1788
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: tools
> Reporter: Jonathan Eagles
> Assignee: John George
> Priority: Minor
>
> ls FsShell command implementation has been consistent with the linux implementations of ls \-l. With the addition of symlinks, I would expect the ability to show file type 'd' for directory, '\-' for file, and 'l' for symlink. In addition, following the linkname entry for symlinks, I would expect the ability to show "\-> <link target>". In linux, the default is to the the properties of the link and not of the link target. In linux, '-L' option allows for the dereferencing of symlinks to show link target properties, but it is not the default.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira