diff options
author | Edoardo La Greca | 2025-08-09 18:44:09 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-09 18:44:09 +0200 |
commit | 8e5b09c28644fba6078728aacf515d1af8c218ba (patch) | |
tree | 4dbd51bcd3b777b391dca3315ff11175663bf62e /src/main/kotlin/ProtocolTranslator.kt | |
parent | bedbcf252d63bcbfc3a4de24a5573667d86ca17d (diff) |
implement open and add FileMode
Diffstat (limited to 'src/main/kotlin/ProtocolTranslator.kt')
-rw-r--r-- | src/main/kotlin/ProtocolTranslator.kt | 10 |
1 files changed, 9 insertions, 1 deletions
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<QID, UInt> /** * Prepare an FID for I/O on a new file. |