From 39d1be7fc92eec3f6f87e67b401fa9d729e12d1e Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 24 Oct 2023 13:41:04 +0100 Subject: [PATCH] Mention file length in bytes in `readFileSize` explicitly (#2572) The rest of the functions on `NonBlockingFileIO` are explicit in the fact that they count buffer length in bytes. `readFileSize` should be explicit in its documentation too. --- Sources/NIOPosix/NonBlockingFileIO.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/NIOPosix/NonBlockingFileIO.swift b/Sources/NIOPosix/NonBlockingFileIO.swift index dacdc576b..2e07175bc 100644 --- a/Sources/NIOPosix/NonBlockingFileIO.swift +++ b/Sources/NIOPosix/NonBlockingFileIO.swift @@ -376,12 +376,12 @@ public struct NonBlockingFileIO: Sendable { } } - /// Returns the length of the file associated with `fileHandle`. + /// Returns the length of the file in bytes associated with `fileHandle`. /// /// - parameters: /// - fileHandle: The `NIOFileHandle` to read from. /// - eventLoop: The `EventLoop` to create the returned `EventLoopFuture` from. - /// - returns: An `EventLoopFuture` which is fulfilled if the write was successful or fails on error. + /// - returns: An `EventLoopFuture` which is fulfilled with the length of the file in bytes if the write was successful or fails on error. public func readFileSize(fileHandle: NIOFileHandle, eventLoop: EventLoop) -> EventLoopFuture { return self.threadPool.runIfActive(eventLoop: eventLoop) {