Open aakashkumar667 opened 6 years ago
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;
});
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"}}