hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owen O'Malley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-125) LocalFileSystem.makeAbsolute bug on Windows
Date Sat, 08 Apr 2006 07:10:45 GMT
    [ http://issues.apache.org/jira/browse/HADOOP-125?page=comments#action_12373713 ] 

Owen O'Malley commented on HADOOP-125:
--------------------------------------

Doug,
   Doesn't your fix break on unix if the user has a directory named "\\foo"? Certainly it
would be a strange name, but it is legal. I was also curious why you took out setting the
System property. It was convienent to be able to set the working directory on the local file
system and be able to use File.getAbsolutePath(). Could we extend the FileSystem interface
to add makeAbsolute?

> LocalFileSystem.makeAbsolute bug on Windows
> -------------------------------------------
>
>          Key: HADOOP-125
>          URL: http://issues.apache.org/jira/browse/HADOOP-125
>      Project: Hadoop
>         Type: Bug

>   Components: fs
>  Environment: Windows
>     Reporter: paul sutter
>     Assignee: Doug Cutting
>     Priority: Minor
>      Fix For: 0.1.1, 0.2

>
> LocalFileSystem.makeAbsolute() has a bug when running on Windows (which is very useful
for the development phase of a Hadoop task on one's laptop).
> Problem:  if a pathname such as /tmp/hadoop... is given in a config file, when the jobconf
file is created, it is put into the relative directory named: currentdir/tmp/hadoop..., but
when hadoop tries to open the file, it looks in c:/tmp/hadoop..., and the job fails.
> Cause: while Unix has two kinds of filespecs (relative and absolute), WIndows actually
has three:
> (1) relative to current directory (subdir/file)
> (2) relative to current disk (/dir/subdir/file)
> (3) absolute (c:/dir/subdir/file)
> So when a config file specifies a directory with what-is-on-unix an absolute path (/tmp/hadoop...),
the makeAbsolute() method will not work correctly. Basically, File.isAbsolute() will return
false for cases (1) and (2) above, but true for case (3), which is not expected by the code
below. 
> The solution would be to code explicit detection of all three casses for Windows in the
code below from LocalFileSystem:
>     private File makeAbsolute(File f) {
>       if (f.isAbsolute()) {
>         return f;
>       } else {
>         return new File(workingDir, f.toString());
>       }
>     }
> Im happy to explain if this explanation is confusing... 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message