Windows itself can handle both styles of path separators, but users might pass in a path that contains a mixture of forward and backward slashes. That's why I chose to sanitize the path first, otherwise this function would fail.