FAQ
Got it! Thanks Jürgen and Lohit!

On Wed, Nov 26, 2008 at 11:10 PM, Jürgen Broß
wrote:
Hi Shane,

I think what you are looking for is the following:

Path dirPath = new Path("path to dir");
FileStatus[] files = FileSystem.get(conf).listStatus(dirPath);

Each FileStatus entry in the above array contains a Path reference
(files[i].getPath()) to the file or directory contained in dirPath.

Greetings,
Jürgen

Shane Butler wrote:
Hi all,

Can someone pls guide me on how to get a directory listing of files on
HDFS using the java API (0.19.0)?

Regards,
Shane

--


Jürgen Broß
Institute of Computer Science
Databases and Information Systems
Freie Universität Berlin
Takustr. 9
D-14195 Berlin, Germany
phone: +49 30 838-75108
email: juergen.bross@fu-berlin.de

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupcommon-user @
categorieshadoop
postedNov 26, '08 at 4:05a
activeNov 26, '08 at 11:21p
posts4
users3
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase