removes complications when srcpath/dstpath or child/parent directories have naming collisions (in particular the json directories).