     self.init(_platformString: platformString)
   }
 
+  /// Creates a file path root by copying bytes from a null-terminated platform
+  /// string. It is a precondition that a null byte indicates the end of
+  /// the string. The absence of a null byte will trigger a runtime error.
+  ///
+  /// Returns `nil` if `platformString` is empty or is not a root.
+  ///
+  /// - Note It is a precondition that `platformString` must be null-terminated.
+  /// The absence of a null byte will trigger a runtime error.
+  ///
+  /// - Parameter platformString: A null-terminated platform string.
+  @inlinable
+  @_alwaysEmitIntoClient
+  public init?(platformString: [CInterop.PlatformChar]) {
+    guard let _ = platformString.firstIndex(of: 0) else {
+      fatalError(
+        "input of FilePath.Root.init?(platformString:) must be null-terminated"
+      )
+    }
+    guard let component = platformString.withUnsafeBufferPointer({
+      FilePath.Root(platformString: $0.baseAddress!)
+    }) else {
+      return nil
+    }
+    self = component
+  }
+
+  @inlinable
+  @_alwaysEmitIntoClient
+  @available(*, deprecated, message: "Use FilePath.Root.init(_: String).")
+  public init?(platformString: inout CInterop.PlatformChar) {
+    guard platformString == 0 else {
+      fatalError(
+        "input of FilePath.Root.init?(platformString:) must be null-terminated"
+      )
+    }
+    return nil
+  }
+
+  @inlinable
+  @_alwaysEmitIntoClient
+  @available(*, deprecated, message: "Use FilePath.Root.init(_: String).")
+  public init?(platformString: String) {
+    let string: String
+    if let nullLoc = platformString.firstIndex(of: "\0") {
+      string = String(platformString[..<nullLoc])
+    } else {
+      string = platformString
+    }
+    guard let root = FilePath.Root(string) else { return nil }
+    self = root
+  }
+
   /// Calls the given closure with a pointer to the contents of the file path
   /// root, represented as a null-terminated platform string.
   ///

extension FilePath {
  /// For backwards compatibility only. This initializer is equivalent to
  /// the preferred `FilePath(platformString:)`.
  public init(cString: UnsafePointer<CChar>) {
    self.init(platformString: cString)
  }


  ///   string.
  public init(platformString: UnsafePointer<CInterop.PlatformChar>) {
    self.init(_platformString: platformString)
  }

  /// Creates a file path by copying bytes from a null-terminated platform
  /// string.
  ///
  /// - Note It is a precondition that `platformString` must be null-terminated.
  /// The absence of a null byte will trigger a runtime error.
  ///
  /// - Parameter platformString: A null-terminated platform string.
  @inlinable
  @_alwaysEmitIntoClient
  public init(platformString: [CInterop.PlatformChar]) {
    guard let _ = platformString.firstIndex(of: 0) else {
      fatalError(
        "input of FilePath.init(platformString:) must be null-terminated"
      )
    }
    self = platformString.withUnsafeBufferPointer {
      FilePath(platformString: $0.baseAddress!)
    }
  }

  @inlinable
  @_alwaysEmitIntoClient
  @available(*, deprecated, message: "Use FilePath(_: String) to create a path from a String.")
  public init(platformString: inout CInterop.PlatformChar) {
    guard platformString == 0 else {
      fatalError(
        "input of FilePath.init(platformString:) must be null-terminated"
      )
    }
    self = FilePath()
  }

  @inlinable
  @_alwaysEmitIntoClient
  @available(*, deprecated, message: "Use FilePath(_: String) to create a path from a String.")
  public init(platformString: String) {
    if let nullLoc = platformString.firstIndex(of: "\0") {
      self = FilePath(String(platformString[..<nullLoc]))
    } else {
      self = FilePath(platformString)
    }
  }

  /// Calls the given closure with a pointer to the contents of the file path,
