Make readblob() possible to read from character device#11407
Closed
k-takata wants to merge 5 commits intovim:masterfrom
Closed
Make readblob() possible to read from character device#11407k-takata wants to merge 5 commits intovim:masterfrom
k-takata wants to merge 5 commits intovim:masterfrom
Conversation
With this patch, readblob() can read from a character device if "offset"
is zero and "size" is specified (on Unix):
```
let b = readblob('/dev/random', 0, 10)
```
(Not sure if this is useful, though.)
Codecov Report
@@ Coverage Diff @@
## master #11407 +/- ##
==========================================
- Coverage 81.82% 81.79% -0.03%
==========================================
Files 162 162
Lines 189685 189687 +2
Branches 43124 43124
==========================================
- Hits 155206 155162 -44
- Misses 21919 21951 +32
- Partials 12560 12574 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Contributor
|
With this patch, readblob() can read from a character device if
"offset" is zero and "size" is specified (on Unix):
```vim
let b = readblob('/dev/random', 0, 10)
```
(Not sure if this is useful, though.)
Hard to say, but it's only a tiny bit of code.
Please also update the help. And add that example.
…--
(letter from Mark to Mike, about the film's probable certificate)
I would like to get back to the Censor and agree to lose the shits, take
the odd Jesus Christ out and lose Oh fuck off, but to retain 'fart in
your general direction', 'castanets of your testicles' and 'oral sex'
and ask him for an 'A' rating on that basis.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Member
Author
|
Updated. |
Member
Hm, why would we read from |
Member
Author
|
Okay, updated. |
Member
Author
|
Updated about {offset} for character devices. |
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this pull request
Feb 28, 2023
Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407) vim/vim@4362576 S_ISCHR is always defined in Nvim. Co-authored-by: K.Takata <kentkt@csc.jp>
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this pull request
Feb 28, 2023
Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407) vim/vim@4362576 S_ISCHR is always defined in Nvim. Co-authored-by: K.Takata <kentkt@csc.jp>
yesean
pushed a commit
to yesean/neovim
that referenced
this pull request
Mar 25, 2023
Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407) vim/vim@4362576 S_ISCHR is always defined in Nvim. Co-authored-by: K.Takata <kentkt@csc.jp>
folke
pushed a commit
to folke/neovim
that referenced
this pull request
May 22, 2023
Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407) vim/vim@4362576 S_ISCHR is always defined in Nvim. Co-authored-by: K.Takata <kentkt@csc.jp>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this patch, readblob() can read from a character device if "offset" is zero and "size" is specified (on Unix):
(Not sure if this is useful, though.)