How can I list disk drives in Haskell? I would like to get disk drive letters on Windows and get just "/" on Linux. Is it possible? I couldn't find it anywhere.
import System.Process
c = do
res <- readProcess "wmic" ["logicaldisk","get","caption"] ""
--print res
-- clean up the output
print $ init $ map (take 2) $ drop 1(lines res)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With