Skip to content

Use diskutil on macOS to extract volume name and path for FAT mounts #4928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 14, 2025

Conversation

mi-bear
Copy link
Contributor

@mi-bear mi-bear commented Jun 13, 2025

Summary

On macOS, this change improves the detection of FAT volumes by parsing diskutil info output to extract the volume name and path. This ensures accurate identification of mounted FAT-based filesystems under /Volumes.

Fixes #4519

Details

  • Replaces hardcoded assumptions about the filesystem layout with dynamic parsing of diskutil info
  • Extracts VolumeName and FileSystemPersonality for each mount point
  • Adds a check for scanner.Err() to handle unexpected parsing issues gracefully
  • Sorts results by volume path for consistent ordering

Platform

  • This change only affects the darwin (macOS) platform
  • No impact on other platforms or existing logic for linux/windows

Copy link
Member

@sago35 sago35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@deadprogram
Copy link
Member

Thank you for the improvement @mi-bear and to @sago35 & @b0ch3nski for review. Now squash/merging.

@deadprogram deadprogram merged commit 330f8c7 into tinygo-org:dev Jun 14, 2025
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants