Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell list drives in Windows

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.

like image 1000
remdezx Avatar asked Sep 05 '13 09:09

remdezx


1 Answers

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)
like image 166
ja. Avatar answered Sep 28 '22 02:09

ja.