[ 
https://issues.apache.org/jira/browse/HADOOP-8872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Mitic updated HADOOP-8872:
-------------------------------

    Attachment: HADOOP-8872.branch-1-win.symlink0.patch

Attaching the patch.

A few notes on the patch:
 - Introduced NativeIO#Windows#getLengthFollowSymlink that provides native 
implementation for File length that also follows symbolic links. 
 - Introduced FileUtil API for extracting the file length that now has the same 
behavior w.r.t. symlinks on different platforms. API first tries to extract the 
file size using native API, and falls back to Shell if native library is not 
loaded. The fallback mechanism was introduced because we generally don't want 
downstream projects to worry about the Native hadoop library.

 
                
> FileSystem#length returns zero for symlinks on windows+java6
> ------------------------------------------------------------
>
>                 Key: HADOOP-8872
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8872
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 1-win
>            Reporter: Ivan Mitic
>            Assignee: Ivan Mitic
>         Attachments: HADOOP-8872.branch-1-win.symlink0.patch
>
>
> RawLocalFileSystem does not work well with symbolic links on Windows. 
> Specifically, calling FileSystem#lengh on the path that is a symlink will 
> return zero. This causes problems in some objects that use LocalFileSystem to 
> access local files. One example is a SequenceFile.
> The issue is caused by Java6 File#length returning zero for symbolic links on 
> Windows. On Java7, we will no longer have this problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to