From 8e5b09c28644fba6078728aacf515d1af8c218ba Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Sat, 9 Aug 2025 18:44:09 +0200 Subject: implement open and add FileMode --- src/main/kotlin/ProtocolTranslator.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/ProtocolTranslator.kt') diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt index b74eef0..b3674f1 100644 --- a/src/main/kotlin/ProtocolTranslator.kt +++ b/src/main/kotlin/ProtocolTranslator.kt @@ -75,8 +75,16 @@ interface ProtocolTranslator { /** * Prepare an FID for I/O on an existing file. + * + * @param fid The FID of the file to open. + * @param mode The mode in which the file is opened. + * @return A pair of: (1) the returned QID, and (2) a value called `iounit` that indicates, if non-zero, the maximum + * number of bytes that are guaranteed to be read from or written to the file without breaking the I/O transfer into + * multiple 9P messages. + * @throws except.InvalidMessageException if the received message is invalid. + * @throws except.RErrorException if the received message is an R-error message. */ - fun open(path: String) + fun open(fid: UInt, mode: FileMode): Pair /** * Prepare an FID for I/O on a new file. -- cgit v1.2.3