Contents

seek(offset:from:)

Repositions the offset for the given file descriptor.

Declaration

@discardableResult func seek(offset: Int64, from whence: FileDescriptor.SeekOrigin) throws -> Int64

Parameters

  • offset:

    The new offset for the file descriptor.

  • whence:

    The origin of the new offset.

Return Value

The file’s offset location, in bytes from the beginning of the file.

Discussion

The corresponding C function is lseek.

See Also

Changing a File’s Offset