Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SR-10277: FileManger: Handle invalid filenames including "" more gracefully #2066

Merged
merged 1 commit into from Apr 10, 2019

Conversation

spevans
Copy link
Collaborator

@spevans spevans commented Apr 7, 2019

  • Add __fileSystemRepresentation(withPath:) which is a throwing version
    to allow validating filenames and throw if invalid or cannot be converted
    to FSR.

  • Update fileSystemRepresentation(withPath::) and
    fileSystemRepresentation(withPath:andPath::) to throw,
    and update callers to catch or propagate the error as required.

  • .attributesOfFileSystem: Call statfs()/statvfs() using the FSR.

  • NSString.deletingLastPathComponent: Fix crash if string is empty.

  • Add tests for calling FileManager methods with empty filename and
    handle the response more gracefully by throwing an exception.

…efully.

- Add __fileSystemRepresentation(withPath:) which is a throwing version
  to allow validating filenames and throw if invalid or cannot be converted
  to FSR.

- Update _fileSystemRepresentation<ResultType>(withPath:_:) and
  _fileSystemRepresentation<ResultType>(withPath:andPath:_:) to throw,
  and update callers to catch or propagate the error as required.

- .attributesOfFileSystem: Call statfs()/statvfs() using the FSR.

- NSString.deletingLastPathComponent: Fix crash if string is empty.

- Add tests for calling FileManager methods with empty filename and
  handle the response more gracefully by throwing an exception.
@spevans
Copy link
Collaborator Author

spevans commented Apr 7, 2019

@swift-ci test

@millenomi
Copy link
Contributor

@swift-ci please test

@spevans
Copy link
Collaborator Author

spevans commented Apr 8, 2019

@swift-ci test

1 similar comment
@spevans
Copy link
Collaborator Author

spevans commented Apr 9, 2019

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants