Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ls throws IOError on empty directories #1

Merged
merged 2 commits into from
Aug 7, 2017
Merged

Conversation

alaendle
Copy link
Contributor

@alaendle alaendle commented Aug 3, 2017

Null is a valid return value for empty directories.

See also: avaranovich/libhdfs#1

Null is a valid return value for empty directories.
@@ -191,12 +191,15 @@ ls :: FileSystem -> Path -> IO [FileInfo]
ls (FileSystem fs) p =
withCString p $ \path ->
alloca $ \numptr -> do
cinfo <- throwErrnoIfNull "ls" $
cinfo <- --throwErrnoIfNull "ls" $
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind just removing the commented code?

@kim
Copy link
Owner

kim commented Aug 4, 2017

Thanks.

Are you actually using this, or planning to? Since CDH 5.x, there exists a much more lightweight and easier to maintain solution for interacting with HDFS.

@alaendle
Copy link
Contributor Author

alaendle commented Aug 5, 2017

Well, I'm currently playing around with it. I've also seen the solution you mentioned, but unfortunately it doesn't support PUT (jacobstanley/hadoop-tools#15) - and so I believe the simple abstraction over hdfslib might be a better fit if I would like to store data in HDFS.

@kim
Copy link
Owner

kim commented Aug 7, 2017

unfortunately it doesn't support PUT

Ok, wasn't aware of that. It doesn't actually seem to be an upstream restriction, though, there is a Go client which seems to support it.

Anyways, if you end up using the code here, be aware that I've never used it for anything serious and would think that it would require some work to make it usable in a production setting. I don't really plan to release/maintain it, but would gladly help out if you'd be taking the lead. The license can also be made more liberal.

@kim kim merged commit 455cc23 into kim:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants