`PC_PATH_MAX` doesn't exist for (some?) external drives on macOS. We need error handling when retrieving this value. Also added error handling for `PC_NAME_MAX` just in case. This does work for me for external drives on macOS, though. Closes #6277