Without knowing more about the context, it's hard to say
whether following symlink is appropriate or not. For all
we know, your solution is wrong because it improperly
does not follow symlinks, which means part of the
directory structure isn't updated.