magicaldave
magicaldave
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
If you happen to be shooting for linux compatibility as well, disk handling works the same way there as macOS, just not using diskutil.
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
If the full proper name was provided, “/dev/disk1” it’d try to format “/dev/dev/disk1” and bust
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
Like, if you gave it the string “C:” a mac is not gonna have a clue what that is regardless.
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
It is, but, where’s the string “disk” come from?
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
I think your biggest problem is actually just going to be figuring out what drive to format. MacOS and linux use a naming scheme that is dramatically different fron Windows’ drive letters.
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
Tbh I’d rely on whatever the system is providing for disk formatting. Why touch that if you don’t have to? Here’s a mac version: https://howchoo.com/apple/format-hard-drive-macos
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
I would probably stick with your current approach and learn more about how to execute what you want fron the commandline using DiskUtil for Mac and CMD for windows.
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
Mmh. Here’s a windows version: https://www.codeproject.com/Articles/115598/Formatting-a-Drive-using-C-and-WMI But this actually uses its code to DO the formatting, where yours is using an external utility to format.
21 replies
CC#
Created by Abdesol on 3/20/2023 in #help
❔ Crossplatform disk formatting code
Disks operate pretty differently per system, are you really trying to reformat them? Or maybe just empty them? Is there a specific format you want?
21 replies