hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Sammer <e...@lifeless.net>
Subject Re: MOVING FILES BETWEEN DIRS IN HDFS
Date Sun, 10 Jan 2010 20:20:05 GMT
On 1/10/10 12:29 PM, Alberto Luengo Cabanillas wrote:
> Hi everyone! I´m trying to move a file from a dir in HDFS to another via API
> (more specifically, with *FileUtil* class). This is because I´m launching a
> program within Eclipse against a remote HDFS. Is the "copy" method proper
> for what I want to do, or is another alternative (like copyTo-copyFrom
> sequence)?
> Thanks a lot in advance.
> 

Alberto:

There is no method for moving a file in FileUtil because it's already
just a single simple method call. Use FileSystem#rename(Path, Path)
instead to move files. The copy methods will leave you with two of the
same file (which you probably don't want).

Hope that helps.
-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com

Mime
View raw message