1
DC Member Programs and Projects / Re: remv: Rename files (and directories) with regular expressions
« on: January 13, 2019, 11:11 AM »Hmm, that might be fixed with a simple call to create_directories before renaming, so the target directories will be created even if the original directories didn't match your regex. But that would lead to empty folders when the files from them have been moved.The program is already set to rename/move files, not directories by themselves.-Tuxman (January 10, 2019, 06:56 PM)
So leaving empty directories behind is both the correct, and expected, behavior. Moving everything out of a directory doesn't necessarily mean that the directory should be deleted, empty directories are a valid entity.
If you want to, it's of course possible to add an optional parameter to check if any directory is being emptied during the run (keep track of location for any file that was moved, and after processing everything check if any of the locations are empty), and then delete them. But, again, while that could certainly be nice, I think it's not required, and it's perfectly fine and normal for empty directories to be left behind if the files inside them were moved elsewhere.