Skip to content

Commit

Permalink
Update file.md, precise read() return data size rules (#50)
Browse files Browse the repository at this point in the history
* Update file.md, precise read() return data size rules

* Update file.md: more precise :read fn range description
  • Loading branch information
fvacek authored Jan 4, 2025
1 parent 9dba97e commit 54093b9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/rpcmethods/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ provided with various, but not all, types of file node modes. The methods
| | `*:crc` / `*:sha1` | `*:read` | `*:write` | `*:truncate` | `*:append` |
|-------------|--------------------|----------|-----------|--------------|------------|
| Read only | ✔️ | ✔️ ||||
| Fixed size | ✔️ | ✔️ | ✔️ | ||
| Resizable | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Append only | ✔️ | ✔️ ||| ✔️ |
| Fixed size | ✔️ | ✔️ | ✔️ |||
| Resizable | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Append only | ✔️ | ✔️ ||| ✔️ |

## `*:stat`

Expand Down Expand Up @@ -162,9 +162,11 @@ allow reading of the file.
|------------|--------|
| [Int, Int] | Bytes |

The parameter must be list with offset and size in bytes that identifies range
to be read. The range can be outside of the file boundaries and in such case
zero length bytes value is provided.
The parameter must be a tuple containing `offset` and `size` in bytes
that identifies the range to be read. The implementation may
return less data than `size`, but it will never return 0 bytes if any data exists
at the specified offset. The range can be outside of the file boundaries and in such case
zero length bytes value is returned.

```
=> <id:42, method:"read", path:"test/file">i{1:[0, 1024]}
Expand Down

0 comments on commit 54093b9

Please sign in to comment.