changeFileSize(fileHandle:size:)

Changes the file size of fileHandle to size.

NonBlockingFileIO.swift:985
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
func changeFileSize(fileHandle: NIOFileHandle, size: Int64) async throws

Parameters

fileHandle

The NIOFileHandle to write to.

size

The new file size in bytes to write.

If size is smaller than the current file size, the remaining bytes will be truncated and are lost. If size is larger than the current file size, the gap will be filled with zero bytes.