diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:47:20 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:47:20 +0100 |
commit | e492608f2f3809a824cb70ee03ff305964b69dd7 (patch) | |
tree | 953ec56c34431549dab177eec9e0fe979606e5eb /haskell | |
parent | 9a92446bcad09b492dee42dd5950bac67073fbea (diff) | |
download | libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.gz libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.tar.xz libguestfs-e492608f2f3809a824cb70ee03ff305964b69dd7.zip |
Generated code for 'du' command.
Diffstat (limited to 'haskell')
-rw-r--r-- | haskell/Guestfs.hs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index dfa385ac..9eefda11 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -119,7 +119,8 @@ module Guestfs ( scrub_freespace, wc_l, wc_w, - wc_c + wc_c, + du ) where import Foreign import Foreign.C @@ -1322,3 +1323,15 @@ wc_c h path = do 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) + |