Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How to delete only empty folders?

Hi,
is there a way of deleting all folders in a hierarchy, that are empty?
I've got a tFileList that list all my directories recursivly and a tFileDelete that deletes folders.
But it may not delete them, if they contain files 0683p000009MPcz.png
Any idea?
Thank you in advance,
Bye, Chris
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

hi,
On *nux you can use :
"rm -r /home/raulier/todelete/"

to delete recursively dir and files "todelete". ... but be very carefull about use it 0683p000009MACn.png
Use a tSystem Componenet in Talend to do it

Perhaps you can check if a dir is empty (if count tfilelist = 0 )or not ... delete file if you 're sure about it and use your code to delete dir .
laurent

View solution in original post

2 Replies
Anonymous
Not applicable
Author

hi,
On *nux you can use :
"rm -r /home/raulier/todelete/"

to delete recursively dir and files "todelete". ... but be very carefull about use it 0683p000009MACn.png
Use a tSystem Componenet in Talend to do it

Perhaps you can check if a dir is empty (if count tfilelist = 0 )or not ... delete file if you 're sure about it and use your code to delete dir .
laurent
Anonymous
Not applicable
Author

That's a great idea ..
I just use the system command.
It deletes every folder that is empty.
Other folders won't be deleted (it throws an error, but it is only a string and continous with the task)
Great, thank you 0683p000009MACn.png