{"id":31278,"date":"2021-01-11T16:35:19","date_gmt":"2021-01-11T21:35:19","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=31278"},"modified":"2021-01-27T16:54:04","modified_gmt":"2021-01-27T21:54:04","slug":"swift-filepath-syntactic-operations","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2021\/01\/11\/swift-filepath-syntactic-operations\/","title":{"rendered":"Swift FilePath Syntactic Operations"},"content":{"rendered":"<p><a href=\"https:\/\/forums.swift.org\/t\/api-review-filepath-syntactic-apis\/43765\">Michael Ilseman<\/a>:<\/p>\n<blockquote cite=\"https:\/\/forums.swift.org\/t\/api-review-filepath-syntactic-apis\/43765\"><p><code>FilePath<\/code> appeared in <a href=\"https:\/\/github.com\/apple\/swift-system\/releases\/tag\/0.0.1\">System 0.0.1<\/a> with a minimal API. This proposal adds API for <em>syntactic operations<\/em>, which are performed on the structure of the path and thus do not consult with the file system or make any system calls. These include inspecting the structure of paths, modifying paths, and accessing individual components.<\/p><p>Additionally, this proposal greatly expands Windows support and enables writing platform-agnostic path manipulation code.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/09\/25\/swift-system-is-now-open-source\/\">Swift System Is Now Open Source<\/a><\/li>\n<\/ul>\n\n<p id=\"swift-filepath-syntactic-operations-update-2021-01-27\">Update (2021-01-27): <a href=\"https:\/\/twitter.com\/Ilseman\/status\/1354226170716278784\">Michael Ilseman<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/Ilseman\/status\/1354226170716278784\">\n<p>Version 2 of <code>FilePath<\/code> Syntactic APIs is <a href=\"https:\/\/forums.swift.org\/t\/api-review-filepath-syntactic-apis-version-2\/44197\">live<\/a>.<\/p>\n<p>Highlight: splitting <code>Root<\/code> off from <code>Component<\/code> lets the type system sort out so many corner cases.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Michael Ilseman: FilePath appeared in System 0.0.1 with a minimal API. This proposal adds API for syntactic operations, which are performed on the structure of the path and thus do not consult with the file system or make any system calls. These include inspecting the structure of paths, modifying paths, and accessing individual components.Additionally, this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2021-01-11T21:35:23Z","apple_news_api_id":"54644949-eff5-47fa-8f74-618be8edfedb","apple_news_api_modified_at":"2021-01-27T21:54:09Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AVGRJSe_1R_qPdGGL6O3-2w","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[31,46,30,71,901,219],"class_list":["post-31278","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-languagedesign","tag-mac","tag-programming","tag-swift-programming-language","tag-windows"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=31278"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31278\/revisions"}],"predecessor-version":[{"id":31470,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31278\/revisions\/31470"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=31278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=31278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=31278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}