Lua File: add readWhole()
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 69/100
Research direction
Start by reading the File and Slice APIs and the five src:read(src:size()) call sites in src/supportpsx/binffi.lua; the Text viewer use in issue #2585 is another example. Add a File:readWhole() method that returns a Slice, with behavior defined for non-seekable or failed files. Done when callers can use the shared method and its failure behavior is clear.
Written by the indexing model from the issue text.
Description
Reading a whole file into a Slice is spelled out by hand in several places: src:read(src:size()) five times in src/supportpsx/binffi.lua, and readAt(f:size(), 0) in the Text viewer of #2585. A File:readWhole() returning the Slice (callers that want a string still tostring it) would give them one name, and a place to define what it does on a non-seekable or failed file.
Raised by @nicolasnoble in review of the TextTable viewer.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 158
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from grumpycoders/pcsx-redux
-
Audio bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
grumpycoders/pcsx-redux#2530 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
grumpycoders/pcsx-redux#2638 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
grumpycoders/pcsx-redux#2608 ·
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
grumpycoders/pcsx-redux#2539 ·
-
Other bug status: in progress
Difficulty 3/5 Half a day Newbie friendliness 68/100
grumpycoders/pcsx-redux#2535 · 1 comment ·
All issues in grumpycoders/pcsx-redux
Similar issues
-
documentation
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
google/tensorstore#305 ·
-
bug module: copilot
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
MaaAssistantArknights/MaaAssistantArknights#19250 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LadybirdBrowser/ladybird#14486 ·
Maintainers usually reply within 1 day