Repository navigation
feat: list the drives that are plugged in - #28
Merged
Merged
Conversation
Choosing a stick meant a folder dialog and knowing where it was mounted. Nobody has /Volumes/... memorised, and the list was already being fetched and thrown away: usb.rs asked the system for every disk, kept the one matching the path, and discarded the rest. The window now lays the screen out the way a player does — what is plugged in down the left, everything known about the chosen one on the right — so moving between two sticks is one click rather than a trip back through a dialog. Each row carries the volume label, the filesystem, the free space and how many of the chosen players read it, with a bar down the leading edge in the colour of that verdict. The bar sits outside the row's own colour, because a verdict that disappears when the row is selected is no verdict. transcrate usb with no path prints the same list. Removable volumes only, which is what separates a stick from the machine's own disk. Nothing else is filtered: a mounted disk image is removable too and will appear, and hiding a volume somebody can see in their file manager would be the worse surprise. The command line also stops giving up early on a filesystem no player reads. It printed that line and returned; the window has always gone on to read the drive anyway, and it is right to. What is written to the stick has to be put right as well, and finding that out only after reformatting means doing the work twice.
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.
Choosing a stick meant a folder dialog and knowing where the thing was mounted. Nobody has
/Volumes/…memorised, and the list was already being fetched and thrown away —usb.rsasked the system for every disk, kept the one matching the path, and discarded the rest.The screen
Laid out the way a player lays out SOURCE: what is plugged in down the left, everything known about the chosen one on the right. The list stays put while the right side is read, so moving between two sticks is one click rather than a trip back through a dialog.
Each row carries the volume label, the filesystem, the free space, and how many of the chosen players read it. A bar runs down the leading edge in the colour of that verdict, and it sits outside the row's own colour — a selected row already carries one, and a verdict that disappears when you select the row is no verdict.
transcrate usbwith no path prints the same list:What is listed
Removable volumes only, which is what separates a stick from the machine's own disk. Verified against a real machine rather than assumed:
Nothing else is filtered. A mounted disk image is removable too and will appear; hiding a volume somebody can see in their file manager would be the worse surprise of the two.
Free space is decimal GB, not binary — it is what the label on the stick says, and being seven per cent off from Finder would look like a bug.
The command line stops giving up early
On a filesystem no player reads it printed one line and returned. The window has always gone on to read the drive anyway, and it is right to: what is written to the stick has to be put right as well, and finding that out only after reformatting means doing the work twice.
Keeping the two front-ends saying the same thing is the reason the core is shared at all, so a divergence found is a divergence to close.
Tests
One new test in
usb.rs, written to hold whatever is plugged into the machine running it: the list is removable volumes only, is stable between two looks, never contains/, and every entry it offers can be answered bydrive_at— or the picker would offer something the check cannot then look at.Checked by hand against three mounted volumes: FAT32 (reads everywhere), exFAT (three players refuse it), and APFS (none do).