stat :: FileSystem -> Path -> IO FileInfo
stat (FileSystem fs) p =
  withCString p $ \path -> do
    cinfo <- throwErrnoIfNull "stat" (c_hdfs_get_path_info fs path)
    info  <- peek cinfo >>= mkFileInfo
    c_hdfs_free_file_info cinfo 1
    return info

-- internal
stat :: FileSystem -> Path -> IO FileInfo
stat (FileSystem fs) p =
  withCString p $ \path -> do
    cinfo <- throwErrnoIfNull "stat" (c_hdfs_get_path_info fs path)
    info  <- peek cinfo >>= mkFileInfo
    c_hdfs_free_file_info cinfo 1
    return info

-- internal
stat (FileSystem fs) p =
  withCString p $ \path -> do
    cinfo <- throwErrnoIfNull "stat" (c_hdfs_get_path_info fs path)
    info  <- peek cinfo >>= mkFileInfo
    c_hdfs_free_file_info cinfo 1
    return info

-- internal