summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2022-10-20 13:28:51 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-20 13:28:51 +0100
commit43625762a9751cc6e6e4d8f54fbc8b82d98fb20d (patch)
tree0261835c4d3eb079e9013ae8277531b12c1d5db2 /runtime
parent4c36678ffd1f933a6d4a12415994dea15e4ccec6 (diff)
patch 9.0.0803: readblob() cannot read from character devicev9.0.0803
Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes #11407)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 9b46d25178..5b383fdfcf 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -6859,7 +6859,12 @@ readblob({fname} [, {offset} [, {size}]]) *readblob()*
readblob('file.bin', 0, 100)
< If {size} is -1 or omitted, the whole data starting from
{offset} will be read.
- When the file can't be opened an error message is given and
+ This can be also used to read the data from a character device
+ on Unix when {size} is explicitly set. Only if the device
+ supports seeking {offset} can be used. Otherwise it should be
+ zero. E.g. to read 10 bytes from a serial console: >
+ readblob('/dev/ttyS0', 0, 10)
+< When the file can't be opened an error message is given and
the result is an empty |Blob|.
When trying to read bytes beyond the end of the file the
result is an empty blob.