cwd :: FileSystem -> IO String
cwd (FileSystem fs) =
  allocaArray 255 $ \buf -> do
    wd <- throwErrnoIfNull "cwd" $
            c_hdfs_get_working_directory fs buf 255
    -- this is kinda silly...
    SBC.unpack <$> SB.packCStringLen (wd, 255)
cwd :: FileSystem -> IO String
cwd (FileSystem fs) =
  allocaArray 255 $ \buf -> do
    wd <- throwErrnoIfNull "cwd" $
            c_hdfs_get_working_directory fs buf 255
    -- this is kinda silly...
    SBC.unpack <$> SB.packCStringLen (wd, 255)
cwd (FileSystem fs) =
  allocaArray 255 $ \buf -> do
    wd <- throwErrnoIfNull "cwd" $
            c_hdfs_get_working_directory fs buf 255
    -- this is kinda silly...
    SBC.unpack <$> SB.packCStringLen (wd, 255)