---
title: "stat(relativeTo:flags:retryOnInterrupt:)"
framework: system
role: symbol
role_heading: Instance Method
path: "system/filepath/stat(relativeto:flags:retryoninterrupt:)"
---

# stat(relativeTo:flags:retryOnInterrupt:)

Creates a Stat struct for the file referenced by this FilePath using the given Flags, including a FileDescriptor to resolve a relative path.

## Declaration

```swift
func stat(relativeTo fd: FileDescriptor, flags: Stat.Flags, retryOnInterrupt: Bool = true) throws(Errno) -> Stat
```

## Discussion

Discussion If path is absolute (starts with a forward slash), then fd is ignored. If path is relative, it is resolved against the directory given by fd. The corresponding C function is fstatat().
