<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSFileName/init(data:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(cs)FSFileName(im)initWithData:"
  },
  "title" : "init(data:)"
}
-->

# init(data:)

Creates a filename by copying a character sequence data object.

```
convenience init(data name: Data)
```

## Parameters

`name`

The data object containing the character sequence to use for the filename. The sequence terminates if a `NUL` character exists prior to `name.length`.

## Discussion

This initializer copies up to `name.length` characters of the sequence pointed to by `bytes`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)