+foreign import ccall unsafe "guestfs_sfdisk" c_sfdisk
+ :: GuestfsP -> CString -> CInt -> CInt -> CInt -> Ptr CString -> IO (CInt)
+
+sfdisk :: GuestfsH -> String -> Int -> Int -> Int -> [String] -> IO ()
+sfdisk h device cyls heads sectors lines = do
+ r <- withCString device $ \device -> withMany withCString lines $ \lines -> withArray0 nullPtr lines $ \lines -> withForeignPtr h (\p -> c_sfdisk p device (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) lines)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_write_file" c_write_file
+ :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
+
+write_file :: GuestfsH -> String -> String -> Int -> IO ()
+write_file h path content size = do
+ r <- withCString path $ \path -> withCString content $ \content -> withForeignPtr h (\p -> c_write_file p path content (fromIntegral size))
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+