<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "System",
  "identifier" : "/documentation/System/Stat/init(_:followTargetSymlink:retryOnInterrupt:)-4apli",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System4StatV_19followTargetSymlink16retryOnInterruptAcA8FilePathV_S2btAA5ErrnoVYKcfc"
  },
  "title" : "init(_:followTargetSymlink:retryOnInterrupt:)"
}
-->

# init(_:followTargetSymlink:retryOnInterrupt:)

Creates a `Stat` struct from a `FilePath`.

```
init(_ path: FilePath, followTargetSymlink: Bool = true, retryOnInterrupt: Bool = true) throws(Errno)
```

## Discussion

`followTargetSymlink` determines the behavior if `path` ends with a symbolic link.
By default, `followTargetSymlink` is `true` and this initializer behaves like `stat()`.
If `followTargetSymlink` is set to `false`, this initializer behaves like `lstat()` and
returns information about the symlink itself.

The corresponding C function is `stat()` or `lstat()` as described above.

---

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)