scrub_freespace,
wc_l,
wc_w,
- wc_c
+ wc_c,
+ du
) where
import Foreign
import Foreign.C
:: GuestfsP -> CString -> CInt -> CInt -> CInt -> CInt -> CString -> IO (CInt)
sfdisk_N :: GuestfsH -> String -> Int -> Int -> Int -> Int -> String -> IO ()
-sfdisk_N h device n cyls heads sectors line = do
- r <- withCString device $ \device -> withCString line $ \line -> withForeignPtr h (\p -> c_sfdisk_N p device (fromIntegral n) (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) line)
+sfdisk_N h device partnum cyls heads sectors line = do
+ r <- withCString device $ \device -> withCString line $ \line -> withForeignPtr h (\p -> c_sfdisk_N p device (fromIntegral partnum) (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) line)
if (r == -1)
then do
err <- last_error h
fail err
else return (fromIntegral r)
+foreign import ccall unsafe "guestfs_du" c_du
+ :: GuestfsP -> CString -> IO (Int64)
+
+du :: GuestfsH -> String -> IO (Integer)
+du h path = do
+ r <- withCString path $ \path -> withForeignPtr h (\p -> c_du p path)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+