# Foundation URL Improvements

**URL:** <https://forums.swift.org/t/foundation-url-improvements/54057>\
**Category:** Core Libraries\
**Tags:** foundation, url\
**Created:** [December 14, 2021, 7:05pm UTC](https://forums.swift.org/t/foundation-url-improvements/54057 "2021-12-14T19:05:12Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![tclementdev](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tclementdev/32/13398_2.png) [@tclementdev](https://forums.swift.org/u/tclementdev)\
**Post date:** [December 15, 2021, 3:55pm UTC](https://forums.swift.org/t/foundation-url-improvements/54057/21 "2021-12-15T15:55:45Z")

</div>

> [@Karl](#):
>
> Unfortunately, `URL.appendingPathComponent` just [forwards](https://github.com/apple/swift-corelibs-foundation/blob/73d1943d0184040688a0f3ba5d66b61ea9e10a09/Sources/Foundation/URL.swift#L784) to `NSURL.appendingPathComponent` , which makes [blocking calls to the filesystem](https://github.com/apple/swift-corelibs-foundation/blob/73d1943d0184040688a0f3ba5d66b61ea9e10a09/Sources/Foundation/NSURL.swift#L860). So does `URL(fileURLWithPath:)` ([here](https://github.com/apple/swift-corelibs-foundation/blob/73d1943d0184040688a0f3ba5d66b61ea9e10a09/Sources/Foundation/NSURL.swift#L217)).

This has always bothered me as well, because what if the path doesn't actually exist on disk at this point? Or what if the path isn't readable from the current process permissions? Or what if the items on disk are later replaced by others (e.g. file could turn into a directory).

It seems like building a path url shouldn't depend on the current state of the filesystem indeed.

---

_[View the full topic](https://forums.swift.org/t/foundation-url-improvements/54057)._
