---
title: "init(rawValue:)"
framework: system
role: symbol
role_heading: Initializer
path: "system/filetype/init(rawvalue:)"
---

# init(rawValue:)

Creates a strongly-typed file type from the raw C mode_t.

## Declaration

```swift
init(rawValue: CInterop.Mode)
```

## Discussion

Discussion note: This initializer stores the rawValue directly and does not mask the value with S_IFMT. If the supplied rawValue contains bits outside of the S_IFMT mask, the resulting FileType will not compare equal to constants like .directory and .symbolicLink, which may be unexpected. If you’re unsure whether the mode_t contains bits outside of S_IFMT, you can use FileMode(rawValue:) instead to get a strongly-typed FileMode, then call .type to get the properly masked FileType.
