Skip to content

Draft: FilePath.ComponentView #2

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

Closed
wants to merge 2 commits into from
Closed

Draft: FilePath.ComponentView #2

wants to merge 2 commits into from

Conversation

milseman
Copy link
Contributor

Draft: Add FilePath.ComponentView, a Bidi RRC of components

Adds in testing infrastructure and collectiony tests, as well
as ad-hoc testing.

Adds mocking and tracing infrastructure, test
infrastructure, and trace-based tests.
Adds in testing infrastructure and collectiony tests, as well
as ad-hoc testing.
@milseman milseman changed the title Proponent view FilePath.ComponentProponentView Sep 25, 2020
@milseman milseman changed the title FilePath.ComponentProponentView FilePath.ComponentView Sep 25, 2020
@milseman milseman changed the title FilePath.ComponentView Draft: FilePath.ComponentView Sep 28, 2020
// Explicitly add a preceding separator if
// replacing front with absolute components (unless redundant by trailing separator),
// preceding character is not a separator (which implies at the end)
let atStart = lowerBound == startIndex
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Account for // special case...

Multiple successive characters are considered to be the same as one , except for the case of exactly two leading characters.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For POSIX, it seems to denote implementation defined path resolution:

A pathname consisting of a single shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. If a pathname begins with two successive characters, the first component following the leading characters may be interpreted in an implementation-defined manner, although more than two leading characters shall be treated as a single character.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13

Copy link
Member

@lorentey lorentey Sep 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luckily, all signs indicate that // is special cased on neither Darwin nor Linux, so there is no need for us to do anything about it. If so, it's okay to treat // as a synonym of / for the purposes of canonicalization and component extraction.

@milseman
Copy link
Contributor Author

milseman commented Nov 5, 2020

This work is superseded by FilePath syntactic operations: #14

@milseman milseman closed this Nov 5, 2020
lorentey added a commit to lorentey/swift-system that referenced this pull request Mar 2, 2021
* Implement UNIX domain socket addresses

* Implement standalone SocketAddress.Family enum

* Add availability comments

* [WIP] Implement sendmsg/rcvmsg

* SocketAddress: Use _RawBuffer.

* ControlMessageBuffer: Fix issues uncovered in testing

* Enums: use mutable rawValues

This helps simplify code that needs to update these directly.

* Update/simplify sendmsg/recvmsg implementations

* Mocking: Add support for wildcard argument matching

* Add some AncillaryMessageBuffer tests; fix issues.

* Apply suggestions from code review

Co-authored-by: Michael Ilseman <[email protected]>

* Make mock failure output a little easier to follow

* Implement support for getaddrinfo

* Add an executable with very simple sample code

* Add availability marker for new CInterop typealiases

* Do not use implicitly unwrapped optionals

* Rework sendmsg/recvmsg, make some samples

* Updates/cleanups/discussion results

Co-authored-by: Michael Ilseman <[email protected]>
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.

2 participants