Escape special characters also in directory names, not only file names.