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

unable to delete a folder which is not empty #27

Open
aakashkumar667 opened this issue Apr 16, 2018 · 1 comment
Open

unable to delete a folder which is not empty #27

aakashkumar667 opened this issue Apr 16, 2018 · 1 comment

Comments

@aakashkumar667
Copy link

hi,
I am unable to delete a folder which is not empty and getting the following error.

{"RemoteException":{"exception":"PathIsNotEmptyDirectoryException","javaClassName":"org.apache.hadoop.fs.PathIsNotEmptyDirectoryException","message":"`/aakash is non empty': Directory is not empty"}}

@SavePointSam
Copy link

In order to delete a directory that has content you need to pass the recursive option as well as a callback for handling errors like so:

import WebHDFS from 'webhdfs';

const client = WebHDFS.createClient({
  host: 'example.dev.company.com',
  port: 8080,
  path: '/',
});

const deleteDirectoryWithContent = (directoryPath) => 
  client.unlink(directoryPath, true, (error) => {
    if (error) throw error;
  });

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

No branches or pull requests

2 participants