diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-28 19:23:28 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-02-28 19:52:45 +0800 |
commit | 4bd0611d7b07b56fc5a9e121669a313166ba540f (patch) | |
tree | 9872da5aad04774dca33d95c6d42140a0c978af0 /runtime | |
parent | bfa0bc7df0ca527fcec49dbd2055f1bac438663e (diff) | |
download | rneovim-4bd0611d7b07b56fc5a9e121669a313166ba540f.tar.gz rneovim-4bd0611d7b07b56fc5a9e121669a313166ba540f.tar.bz2 rneovim-4bd0611d7b07b56fc5a9e121669a313166ba540f.zip |
vim-patch:9.0.0803: readblob() cannot read from character device
Problem: readblob() cannot read from character device.
Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407)
https://github.com/vim/vim/commit/43625762a9751cc6e6e4d8f54fbc8b82d98fb20d
S_ISCHR is always defined in Nvim.
Co-authored-by: K.Takata <kentkt@csc.jp>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 113703680f..eab415f495 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -6164,7 +6164,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. |