Show HN: TapeHead – A CLI tool for stateful random access of file streams

https://news.ycombinator.com/rss Hits: 1
Summary

TapeHead A command-line utility for random access of file streams. Preview File: "test.txt" (67 bytes) [RW] [pos:0]> seek 10 [pos:10]> read . 5 ello! [in:5, pos:15]> read 9 5 hello [in:5, pos:14]> quit Screen recording demo The tool runs a REPL session in which you can run commands to read, write, and seek to any position within the file stream. It's quite useful for tasks like debugging a driver, or anything that has to do with file streams. Installation cargo install --git https://github.com/emamoah/tapehead.git Motivation I wrote a shabby version of this when I was trying to debug my scull driver, which controls a simple virtual character device. I was amazed I couldn't find a tool that allowed me to statefully seek, read and write to a file, so I just improvised some code. After that, I thought it a good idea to rewrite it properly and publish it, in case someone else one day might need it too. The initial name I thought to give it was "seeker" (since seeking was the most important aspect) but there was already a crate with that name, so I came up with "TapeHead" which also characterises the tool's behaviour quite well. Running $ tapehead test.txt Interface TapeHead v0.1.0 Author: Emmanuel Amoah (https://emamoah.com/) Enter "help" for more information. File: "test.txt" (67 bytes) [RW] [pos:0]> After the prologue is a line with the following details about the opened file: File: "test.txt" (67 bytes) [RW] ^ ^ ^ filepath filesize permissions The permissions can be one of these three, detected automatically when opening the file: [RW] - Readable & Writable - Readable & Writable [RO] - Read-only - Read-only [WO] - Write-only Prompt The prompt contains a combination of the following segments: pos:<number> - Current position of the file pointer, always shown. If the stream is not seekable (e.g., a Unix FIFO), it displays a * instead of a number. - Current position of the file pointer, always shown. If the stream is not seekable (e.g., a Unix FIFO), it displays a instea...

First seen: 2025-12-06 22:20

Last seen: 2025-12-06 22:20