Mercurial > vim
comparison runtime/doc/builtin.txt @ 30952:61558a67630a v9.0.0810
patch 9.0.0810: readblob() returns empty when trying to read too much
Commit: https://github.com/vim/vim/commit/5b2a3d77d320d76f12b1666938a9d58c2a848205
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Oct 21 11:25:30 2022 +0100
patch 9.0.0810: readblob() returns empty when trying to read too much
Problem: readblob() returns empty when trying to read too much.
Solution: Return what is available.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Oct 2022 12:30:05 +0200 |
parents | 84f6f91ca02a |
children | 122f883d7237 |
comparison
equal
deleted
inserted
replaced
30951:f2dd117ca94c | 30952:61558a67630a |
---|---|
6864 supports seeking {offset} can be used. Otherwise it should be | 6864 supports seeking {offset} can be used. Otherwise it should be |
6865 zero. E.g. to read 10 bytes from a serial console: > | 6865 zero. E.g. to read 10 bytes from a serial console: > |
6866 readblob('/dev/ttyS0', 0, 10) | 6866 readblob('/dev/ttyS0', 0, 10) |
6867 < When the file can't be opened an error message is given and | 6867 < When the file can't be opened an error message is given and |
6868 the result is an empty |Blob|. | 6868 the result is an empty |Blob|. |
6869 When trying to read bytes beyond the end of the file the | 6869 When the offset is beyond the end of the file the result is an |
6870 result is an empty blob. | 6870 empty blob. |
6871 When trying to read more bytes than are available the result | |
6872 is truncated. | |
6871 Also see |readfile()| and |writefile()|. | 6873 Also see |readfile()| and |writefile()|. |
6872 | 6874 |
6873 | 6875 |
6874 readdir({directory} [, {expr} [, {dict}]]) *readdir()* | 6876 readdir({directory} [, {expr} [, {dict}]]) *readdir()* |
6875 Return a list with file and directory names in {directory}. | 6877 Return a list with file and directory names in {directory}. |