---
title: offsetInFile
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/filehandle/offsetinfile
---

# offsetInFile

The position of the file pointer within the file represented by the file handle.

## Declaration

```swift
var offsetInFile: UInt64 { get }
```

## Discussion

Discussion Raises fileHandleOperationException if called on a file handle representing a pipe or socket, or if the file descriptor is closed.

## See Also

### Deprecated

- [readDataToEndOfFile()](foundation/filehandle/readdatatoendoffile().md)
- [readData(ofLength:)](foundation/filehandle/readdata(oflength:).md)
- [write(_:)](foundation/filehandle/write(_:).md)
- [seekToEndOfFile()](foundation/filehandle/seektoendoffile().md)
- [seek(toFileOffset:)](foundation/filehandle/seek(tofileoffset:).md)
- [closeFile()](foundation/filehandle/closefile().md)
- [synchronizeFile()](foundation/filehandle/synchronizefile().md)
- [truncateFile(atOffset:)](foundation/filehandle/truncatefile(atoffset:).md)
- [NSFileHandleNotificationMonitorModes](foundation/nsfilehandlenotificationmonitormodes.md)
