module System.GIO.File.File (
FileProgressCallback,
FileReadMoreCallback,
FileClass,
File(..),
FileQueryInfoFlags(..),
FileCreateFlags(..),
FileCopyFlags(..),
FileMonitorFlags(..),
FilesystemPreviewType(..),
FileType(..),
fileFromPath,
fileFromURI,
fileFromCommandlineArg,
fileFromParseName,
fileEqual,
fileBasename,
filePath,
fileHasParent,
fileURI,
fileParseName,
fileGetChild,
fileGetChildForDisplayName,
fileHasPrefix,
fileGetRelativePath,
fileResolveRelativePath,
fileIsNative,
fileHasURIScheme,
fileURIScheme,
fileRead,
fileReadAsync,
fileReadFinish,
fileAppendTo,
fileCreate,
fileReplace,
fileAppendToAsync,
fileAppendToFinish,
fileCreateAsync,
fileCreateFinish,
fileReplaceAsync,
fileReplaceFinish,
fileQueryInfo,
fileQueryInfoAsync,
fileQueryInfoFinish,
fileQueryExists,
fileQueryFileType,
fileQueryFilesystemInfo,
fileQueryFilesystemInfoAsync,
fileQueryFilesystemInfoFinish,
fileQueryDefaultHandler,
fileFindEnclosingMount,
fileFindEnclosingMountAsync,
fileFindEnclosingMountFinish,
fileEnumerateChildren,
fileEnumerateChildrenAsync,
fileEnumerateChildrenFinish,
fileSetDisplayName,
fileSetDisplayNameAsync,
fileSetDisplayNameFinish,
fileDelete,
fileTrash,
fileCopy,
fileCopyAsync,
fileCopyFinish,
fileMove,
fileMakeDirectory,
fileMakeDirectoryWithParents,
fileMakeSymbolicLink,
fileQuerySettableAttributes,
fileQueryWritableNamespaces
) where
import Control.Monad
import qualified Data.ByteString as BS
import Data.Typeable
import System.Glib.FFI
import System.Glib.Flags
import System.Glib.GError
import System.Glib.UTFString
import System.Glib.GObject
import System.GIO.Base
import System.GIO.Types
import System.GIO.File.FileAttribute
data FileQueryInfoFlags = FileQueryInfoNone
| FileQueryInfoNofollowSymlinks
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FileQueryInfoFlags where
fromEnum FileQueryInfoNone = 0
fromEnum FileQueryInfoNofollowSymlinks = 1
toEnum 0 = FileQueryInfoNone
toEnum 1 = FileQueryInfoNofollowSymlinks
toEnum unmatched = error ("FileQueryInfoFlags.toEnum: Cannot match " ++ show unmatched)
succ FileQueryInfoNone = FileQueryInfoNofollowSymlinks
succ _ = undefined
pred FileQueryInfoNofollowSymlinks = FileQueryInfoNone
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FileQueryInfoNofollowSymlinks
enumFromThen _ _ = error "Enum FileQueryInfoFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FileQueryInfoFlags: enumFromThenTo not implemented"
instance Flags FileQueryInfoFlags
data FileCreateFlags = FileCreateNone
| FileCreatePrivate
| FileCreateReplaceDestination
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FileCreateFlags where
fromEnum FileCreateNone = 0
fromEnum FileCreatePrivate = 1
fromEnum FileCreateReplaceDestination = 2
toEnum 0 = FileCreateNone
toEnum 1 = FileCreatePrivate
toEnum 2 = FileCreateReplaceDestination
toEnum unmatched = error ("FileCreateFlags.toEnum: Cannot match " ++ show unmatched)
succ FileCreateNone = FileCreatePrivate
succ FileCreatePrivate = FileCreateReplaceDestination
succ _ = undefined
pred FileCreatePrivate = FileCreateNone
pred FileCreateReplaceDestination = FileCreatePrivate
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FileCreateReplaceDestination
enumFromThen _ _ = error "Enum FileCreateFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FileCreateFlags: enumFromThenTo not implemented"
instance Flags FileCreateFlags
data FileCopyFlags = FileCopyNone
| FileCopyOverwrite
| FileCopyBackup
| FileCopyNofollowSymlinks
| FileCopyAllMetadata
| FileCopyNoFallbackForMove
| FileCopyTargetDefaultPerms
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FileCopyFlags where
fromEnum FileCopyNone = 0
fromEnum FileCopyOverwrite = 1
fromEnum FileCopyBackup = 2
fromEnum FileCopyNofollowSymlinks = 4
fromEnum FileCopyAllMetadata = 8
fromEnum FileCopyNoFallbackForMove = 16
fromEnum FileCopyTargetDefaultPerms = 32
toEnum 0 = FileCopyNone
toEnum 1 = FileCopyOverwrite
toEnum 2 = FileCopyBackup
toEnum 4 = FileCopyNofollowSymlinks
toEnum 8 = FileCopyAllMetadata
toEnum 16 = FileCopyNoFallbackForMove
toEnum 32 = FileCopyTargetDefaultPerms
toEnum unmatched = error ("FileCopyFlags.toEnum: Cannot match " ++ show unmatched)
succ FileCopyNone = FileCopyOverwrite
succ FileCopyOverwrite = FileCopyBackup
succ FileCopyBackup = FileCopyNofollowSymlinks
succ FileCopyNofollowSymlinks = FileCopyAllMetadata
succ FileCopyAllMetadata = FileCopyNoFallbackForMove
succ FileCopyNoFallbackForMove = FileCopyTargetDefaultPerms
succ _ = undefined
pred FileCopyOverwrite = FileCopyNone
pred FileCopyBackup = FileCopyOverwrite
pred FileCopyNofollowSymlinks = FileCopyBackup
pred FileCopyAllMetadata = FileCopyNofollowSymlinks
pred FileCopyNoFallbackForMove = FileCopyAllMetadata
pred FileCopyTargetDefaultPerms = FileCopyNoFallbackForMove
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FileCopyTargetDefaultPerms
enumFromThen _ _ = error "Enum FileCopyFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FileCopyFlags: enumFromThenTo not implemented"
instance Flags FileCopyFlags
data FileMonitorFlags = FileMonitorNone
| FileMonitorWatchMounts
| FileMonitorSendMoved
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FileMonitorFlags where
fromEnum FileMonitorNone = 0
fromEnum FileMonitorWatchMounts = 1
fromEnum FileMonitorSendMoved = 2
toEnum 0 = FileMonitorNone
toEnum 1 = FileMonitorWatchMounts
toEnum 2 = FileMonitorSendMoved
toEnum unmatched = error ("FileMonitorFlags.toEnum: Cannot match " ++ show unmatched)
succ FileMonitorNone = FileMonitorWatchMounts
succ FileMonitorWatchMounts = FileMonitorSendMoved
succ _ = undefined
pred FileMonitorWatchMounts = FileMonitorNone
pred FileMonitorSendMoved = FileMonitorWatchMounts
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FileMonitorSendMoved
enumFromThen _ _ = error "Enum FileMonitorFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FileMonitorFlags: enumFromThenTo not implemented"
instance Flags FileMonitorFlags
data FilesystemPreviewType = FilesystemPreviewTypeIfAlways
| FilesystemPreviewTypeIfLocal
| FilesystemPreviewTypeNever
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FilesystemPreviewType where
fromEnum FilesystemPreviewTypeIfAlways = 0
fromEnum FilesystemPreviewTypeIfLocal = 1
fromEnum FilesystemPreviewTypeNever = 2
toEnum 0 = FilesystemPreviewTypeIfAlways
toEnum 1 = FilesystemPreviewTypeIfLocal
toEnum 2 = FilesystemPreviewTypeNever
toEnum unmatched = error ("FilesystemPreviewType.toEnum: Cannot match " ++ show unmatched)
succ FilesystemPreviewTypeIfAlways = FilesystemPreviewTypeIfLocal
succ FilesystemPreviewTypeIfLocal = FilesystemPreviewTypeNever
succ _ = undefined
pred FilesystemPreviewTypeIfLocal = FilesystemPreviewTypeIfAlways
pred FilesystemPreviewTypeNever = FilesystemPreviewTypeIfLocal
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FilesystemPreviewTypeNever
enumFromThen _ _ = error "Enum FilesystemPreviewType: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FilesystemPreviewType: enumFromThenTo not implemented"
data FileType = FileTypeUnknown
| FileTypeRegular
| FileTypeDirectory
| FileTypeSymbolicLink
| FileTypeSpecial
| FileTypeShortcut
| FileTypeMountable
deriving (Eq,Ord,Bounded,Show,Typeable)
instance Enum FileType where
fromEnum FileTypeUnknown = 0
fromEnum FileTypeRegular = 1
fromEnum FileTypeDirectory = 2
fromEnum FileTypeSymbolicLink = 3
fromEnum FileTypeSpecial = 4
fromEnum FileTypeShortcut = 5
fromEnum FileTypeMountable = 6
toEnum 0 = FileTypeUnknown
toEnum 1 = FileTypeRegular
toEnum 2 = FileTypeDirectory
toEnum 3 = FileTypeSymbolicLink
toEnum 4 = FileTypeSpecial
toEnum 5 = FileTypeShortcut
toEnum 6 = FileTypeMountable
toEnum unmatched = error ("FileType.toEnum: Cannot match " ++ show unmatched)
succ FileTypeUnknown = FileTypeRegular
succ FileTypeRegular = FileTypeDirectory
succ FileTypeDirectory = FileTypeSymbolicLink
succ FileTypeSymbolicLink = FileTypeSpecial
succ FileTypeSpecial = FileTypeShortcut
succ FileTypeShortcut = FileTypeMountable
succ _ = undefined
pred FileTypeRegular = FileTypeUnknown
pred FileTypeDirectory = FileTypeRegular
pred FileTypeSymbolicLink = FileTypeDirectory
pred FileTypeSpecial = FileTypeSymbolicLink
pred FileTypeShortcut = FileTypeSpecial
pred FileTypeMountable = FileTypeShortcut
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x FileTypeMountable
enumFromThen _ _ = error "Enum FileType: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum FileType: enumFromThenTo not implemented"
type FileProgressCallback = Offset -> Offset -> IO ()
type CFileProgressCallback = (CLLong) -> (CLLong) -> Ptr () -> IO ()
foreign import ccall "wrapper"
makeFileProgressCallback :: CFileProgressCallback
-> IO ((FunPtr (CLLong -> (CLLong -> ((Ptr ()) -> (IO ()))))))
marshalFileProgressCallback :: FileProgressCallback -> IO ((FunPtr (CLLong -> (CLLong -> ((Ptr ()) -> (IO ()))))))
marshalFileProgressCallback fileProgressCallback =
makeFileProgressCallback cFileProgressCallback
where cFileProgressCallback :: CFileProgressCallback
cFileProgressCallback cCurrentNumBytes cTotalNumBytes _ = do
fileProgressCallback (fromIntegral cCurrentNumBytes)
(fromIntegral cTotalNumBytes)
type FileReadMoreCallback = BS.ByteString -> IO Bool
fileFromPath :: FilePath -> File
fileFromPath path =
unsafePerformIO $ withUTFString path $ \cPath -> g_file_new_for_path cPath >>= takeGObject
fileFromURI :: String -> File
fileFromURI uri =
unsafePerformIO $ withUTFString uri $ \cURI -> g_file_new_for_uri cURI >>= takeGObject
fileFromCommandlineArg :: String -> File
fileFromCommandlineArg arg =
unsafePerformIO $ withUTFString arg $ \cArg -> g_file_new_for_commandline_arg cArg >>= takeGObject
fileFromParseName :: String -> File
fileFromParseName parseName =
unsafePerformIO $ withUTFString parseName $ \cParseName -> g_file_parse_name cParseName >>= takeGObject
fileEqual :: (FileClass file1, FileClass file2)
=> file1 -> file2 -> Bool
fileEqual file1 file2 =
unsafePerformIO $ liftM toBool $ (\(File arg1) (File arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_equal argPtr1 argPtr2) (toFile file1) (toFile file2)
instance Eq File where
(==) = fileEqual
fileBasename :: FileClass file => file -> String
fileBasename file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_basename argPtr1) (toFile file) >>= readUTFString
filePath :: FileClass file => file -> FilePath
filePath file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_path argPtr1) (toFile file) >>= readUTFString
fileURI :: FileClass file => file -> String
fileURI file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_uri argPtr1) (toFile file) >>= readUTFString
fileParseName :: FileClass file => file -> String
fileParseName file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_parse_name argPtr1) (toFile file) >>= readUTFString
fileParent :: FileClass file => file -> Maybe File
fileParent file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_parent argPtr1) (toFile file) >>= maybePeek takeGObject
fileHasParent :: FileClass file => file -> Maybe File -> Bool
fileHasParent file parent =
unsafePerformIO $ liftM toBool $
withGObject (toFile file) $ \cFile ->
maybeWith withGObject parent $ \parentPtr ->
g_file_has_parent cFile parentPtr
where _ = (\(File arg1) (File arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_has_parent argPtr1 argPtr2)
fileGetChild :: FileClass file => file -> String -> File
fileGetChild file name =
unsafePerformIO $
withUTFString name $ \cName ->
(\(File arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_child argPtr1 arg2) (toFile file) cName >>= takeGObject
fileGetChildForDisplayName :: FileClass file => file -> String -> Maybe File
fileGetChildForDisplayName file displayName =
unsafePerformIO $
withUTFString displayName $ \cDisplayName ->
propagateGError ((\(File arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_child_for_display_name argPtr1 arg2 arg3) (toFile file) cDisplayName) >>=
maybePeek takeGObject
fileHasPrefix :: (FileClass file1, FileClass file2) => file1 -> file2 -> Bool
fileHasPrefix file1 file2 =
unsafePerformIO $
liftM toBool $ (\(File arg1) (File arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_has_prefix argPtr1 argPtr2) (toFile file1) (toFile file2)
fileGetRelativePath :: (FileClass file1, FileClass file2) => file1 -> file2 -> Maybe FilePath
fileGetRelativePath file1 file2 =
unsafePerformIO $
(\(File arg1) (File arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_get_relative_path argPtr1 argPtr2) (toFile file1) (toFile file2) >>=
maybePeek readUTFString
fileResolveRelativePath :: FileClass file => file -> FilePath -> Maybe File
fileResolveRelativePath file relativePath =
unsafePerformIO $
withUTFString relativePath $ \cRelativePath ->
(\(File arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->g_file_resolve_relative_path argPtr1 arg2) (toFile file) cRelativePath >>=
maybePeek takeGObject
fileIsNative :: FileClass file => file -> Bool
fileIsNative =
unsafePerformIO .
liftM toBool . (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_is_native argPtr1) . toFile
fileHasURIScheme :: FileClass file => file -> String -> Bool
fileHasURIScheme file uriScheme =
unsafePerformIO $
withUTFString uriScheme $ \cURIScheme ->
liftM toBool $ (\(File arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->g_file_has_uri_scheme argPtr1 arg2) (toFile file) cURIScheme
fileURIScheme :: FileClass file => file -> String
fileURIScheme file =
unsafePerformIO $ (\(File arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_file_get_uri_scheme argPtr1) (toFile file) >>= readUTFString
fileRead :: FileClass file => file -> Maybe Cancellable -> IO FileInputStream
fileRead file (Just cancellable) = constructNewGObject mkFileInputStream $
propagateGError $ (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_read argPtr1 argPtr2 arg3) (toFile file) cancellable
fileRead file Nothing = constructNewGObject mkFileInputStream $
propagateGError $ (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_read argPtr1 argPtr2 arg3) (toFile file) (Cancellable nullForeignPtr)
fileReadAsync :: FileClass file
=> file
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileReadAsync file ioPriority mbCancellable callback =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject mbCancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_read_async cFile
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_read_async argPtr1 arg2 argPtr3 arg4 arg5)
fileReadFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileInputStream
fileReadFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_read_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>= takeGObject
fileAppendTo :: FileClass file
=> file
-> [FileCreateFlags]
-> Maybe Cancellable
-> IO FileOutputStream
fileAppendTo file flags cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_append_to cFile (cFromFlags flags) cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_append_to argPtr1 arg2 argPtr3 arg4)
fileCreate :: FileClass file
=> file
-> [FileCreateFlags]
-> Maybe Cancellable
-> IO FileOutputStream
fileCreate file flags cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_create cFile (cFromFlags flags) cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_create argPtr1 arg2 argPtr3 arg4)
fileReplace :: FileClass file
=> file
-> Maybe String
-> Bool
-> [FileCreateFlags]
-> Maybe Cancellable
-> IO FileOutputStream
fileReplace file etag makeBackup flags cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withUTFString etag $ \cEtag ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_replace cFile
cEtag
(fromBool makeBackup)
(cFromFlags flags) cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 arg3 arg4 (Cancellable arg5) arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->g_file_replace argPtr1 arg2 arg3 arg4 argPtr5 arg6)
fileAppendToAsync :: FileClass file
=> file
-> [FileCreateFlags]
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileAppendToAsync file flags ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_append_to_async cFile
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_append_to_async argPtr1 arg2 arg3 argPtr4 arg5 arg6)
fileAppendToFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileOutputStream
fileAppendToFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_append_to_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>= takeGObject
fileCreateAsync :: FileClass file
=> file
-> [FileCreateFlags]
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileCreateAsync file flags ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_create_async cFile
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_create_async argPtr1 arg2 arg3 argPtr4 arg5 arg6)
fileCreateFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileOutputStream
fileCreateFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_create_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>= takeGObject
fileReplaceAsync :: FileClass file
=> file
-> String
-> Bool
-> [FileCreateFlags]
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileReplaceAsync file etag makeBackup flags ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
withUTFString etag $ \cEtag ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_replace_async cFile
cEtag
(fromBool makeBackup)
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 arg4 arg5 (Cancellable arg6) arg7 arg8 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg6 $ \argPtr6 ->g_file_replace_async argPtr1 arg2 arg3 arg4 arg5 argPtr6 arg7 arg8)
fileReplaceFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileOutputStream
fileReplaceFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_replace_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>= takeGObject
fileQueryInfo :: FileClass file
=> file
-> String
-> [FileQueryInfoFlags]
-> Maybe Cancellable
-> IO FileInfo
fileQueryInfo file attributes flags cancellable =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_query_info cFile cAttributes (cFromFlags flags) cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_query_info argPtr1 arg2 arg3 argPtr4 arg5)
fileQueryInfoAsync :: FileClass file
=> file
-> String
-> [FileQueryInfoFlags]
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileQueryInfoAsync file attributes flags ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_query_info_async cFile
cAttributes
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 arg4 (Cancellable arg5) arg6 arg7 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->g_file_query_info_async argPtr1 arg2 arg3 arg4 argPtr5 arg6 arg7)
fileQueryInfoFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileInfo
fileQueryInfoFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_info_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>= takeGObject
fileQueryExists :: FileClass file
=> file
-> Maybe Cancellable
-> IO Bool
fileQueryExists file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
liftM toBool $ g_file_query_exists cFile cCancellable
where _ = (\(File arg1) (Cancellable arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_exists argPtr1 argPtr2)
fileQueryFileType :: FileClass file
=> file
-> [FileQueryInfoFlags]
-> Maybe Cancellable
-> IO FileType
fileQueryFileType file flags cancellable =
liftM (toEnum . fromIntegral) $
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
(g_file_query_file_type cFile (cFromFlags flags) cCancellable)
where _ = (\(File arg1) arg2 (Cancellable arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_query_file_type argPtr1 arg2 argPtr3)
fileQueryFilesystemInfo :: FileClass file
=> file
-> String
-> Maybe Cancellable
-> IO FileInfo
fileQueryFilesystemInfo file attributes cancellable =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_query_filesystem_info cFile cAttributes cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_query_filesystem_info argPtr1 arg2 argPtr3 arg4)
fileQueryFilesystemInfoAsync :: FileClass file
=> file
-> String
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileQueryFilesystemInfoAsync file attributes ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_query_filesystem_info_async cFile
cAttributes
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_query_filesystem_info_async argPtr1 arg2 arg3 argPtr4 arg5 arg6)
fileQueryFilesystemInfoFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileInfo
fileQueryFilesystemInfoFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_filesystem_info_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>=
takeGObject
fileQueryDefaultHandler :: FileClass file
=> file
-> Maybe Cancellable
-> IO AppInfo
fileQueryDefaultHandler file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_query_default_handler cFile cCancellable) >>=
takeGObject
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_default_handler argPtr1 argPtr2 arg3)
fileFindEnclosingMount :: FileClass file
=> file
-> Maybe Cancellable
-> IO Mount
fileFindEnclosingMount file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_find_enclosing_mount cFile cCancellable) >>=
takeGObject
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_find_enclosing_mount argPtr1 argPtr2 arg3)
fileFindEnclosingMountAsync :: FileClass file
=> file
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileFindEnclosingMountAsync file ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_find_enclosing_mount_async cFile
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_find_enclosing_mount_async argPtr1 arg2 argPtr3 arg4 arg5)
fileFindEnclosingMountFinish :: FileClass file
=> file
-> AsyncResult
-> IO Mount
fileFindEnclosingMountFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_find_enclosing_mount_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>=
takeGObject
fileEnumerateChildren :: FileClass file
=> file
-> String
-> [FileQueryInfoFlags]
-> Maybe Cancellable
-> IO FileEnumerator
fileEnumerateChildren file attributes flags cancellable =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_enumerate_children cFile cAttributes (cFromFlags flags) cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_enumerate_children argPtr1 arg2 arg3 argPtr4 arg5)
fileEnumerateChildrenAsync :: FileClass file
=> file
-> String
-> [FileQueryInfoFlags]
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileEnumerateChildrenAsync file attributes flags ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
withUTFString attributes $ \cAttributes ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_enumerate_children_async cFile
cAttributes
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 arg4 (Cancellable arg5) arg6 arg7 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->g_file_enumerate_children_async argPtr1 arg2 arg3 arg4 argPtr5 arg6 arg7)
fileEnumerateChildrenFinish :: FileClass file
=> file
-> AsyncResult
-> IO FileEnumerator
fileEnumerateChildrenFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_enumerate_children_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>=
takeGObject
fileSetDisplayName :: FileClass file
=> file
-> String
-> Maybe Cancellable
-> IO File
fileSetDisplayName file displayName cancellable =
withGObject (toFile file) $ \cFile ->
withUTFString displayName $ \cDisplayName ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_set_display_name cFile cDisplayName cCancellable) >>=
takeGObject
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_set_display_name argPtr1 arg2 argPtr3 arg4)
fileSetDisplayNameAsync :: FileClass file
=> file
-> String
-> Int
-> Maybe Cancellable
-> AsyncReadyCallback
-> IO ()
fileSetDisplayNameAsync file displayName ioPriority cancellable callback =
withGObject (toFile file) $ \cFile ->
withUTFString displayName $ \cDisplayName ->
maybeWith withGObject cancellable $ \cCancellable -> do
cCallback <- marshalAsyncReadyCallback callback
g_file_set_display_name_async cFile
cDisplayName
(fromIntegral ioPriority)
cCancellable
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) arg2 arg3 (Cancellable arg4) arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->g_file_set_display_name_async argPtr1 arg2 arg3 argPtr4 arg5 arg6)
fileSetDisplayNameFinish :: FileClass file
=> file
-> AsyncResult
-> IO File
fileSetDisplayNameFinish file asyncResult =
propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_set_display_name_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult) >>=
takeGObject
fileDelete :: FileClass file
=> file
-> Maybe Cancellable
-> IO ()
fileDelete file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_delete cFile cCancellable) >> return ()
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_delete argPtr1 argPtr2 arg3)
fileTrash :: FileClass file
=> file
-> Maybe Cancellable
-> IO ()
fileTrash file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable ->
propagateGError (g_file_trash cFile cCancellable) >> return ()
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_trash argPtr1 argPtr2 arg3)
fileCopy :: (FileClass source, FileClass destination)
=> source
-> destination
-> [FileCopyFlags]
-> Maybe Cancellable
-> Maybe FileProgressCallback
-> IO Bool
fileCopy source destination flags cancellable progressCallback =
withGObject (toFile source) $ \cSource ->
withGObject (toFile destination) $ \cDestination ->
maybeWith withGObject cancellable $ \cCancellable -> do
cProgressCallback <- maybe (return nullFunPtr) marshalFileProgressCallback progressCallback
propagateGError $ \cError -> do
ret <- g_file_copy cSource
cDestination
(cFromFlags flags)
cCancellable
cProgressCallback
nullPtr
cError
when (cProgressCallback /= nullFunPtr) $
freeHaskellFunPtr cProgressCallback
return $ toBool ret
where _ = (\(File arg1) (File arg2) arg3 (Cancellable arg4) arg5 arg6 arg7 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg4 $ \argPtr4 ->g_file_copy argPtr1 argPtr2 arg3 argPtr4 arg5 arg6 arg7)
fileCopyAsync :: (FileClass source, FileClass destination)
=> source
-> destination
-> [FileCopyFlags]
-> Int
-> Maybe Cancellable
-> Maybe FileProgressCallback
-> AsyncReadyCallback
-> IO ()
fileCopyAsync source destination flags ioPriority cancellable progressCallback callback =
withGObject (toFile source) $ \cSource ->
withGObject (toFile destination) $ \cDestination ->
maybeWith withGObject cancellable $ \cCancellable -> do
cProgressCallback <- maybe (return nullFunPtr) marshalFileProgressCallback progressCallback
cCallback <- marshalAsyncReadyCallback $ \sourceObject res -> do
when (cProgressCallback /= nullFunPtr) $
freeHaskellFunPtr cProgressCallback
callback sourceObject res
g_file_copy_async cSource
cDestination
(cFromFlags flags)
(fromIntegral ioPriority)
cCancellable
cProgressCallback
nullPtr
cCallback
(castFunPtrToPtr cCallback)
where _ = (\(File arg1) (File arg2) arg3 arg4 (Cancellable arg5) arg6 arg7 arg8 arg9 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg5 $ \argPtr5 ->g_file_copy_async argPtr1 argPtr2 arg3 arg4 argPtr5 arg6 arg7 arg8 arg9)
fileCopyFinish :: FileClass file
=> file
-> AsyncResult
-> IO Bool
fileCopyFinish file asyncResult =
liftM toBool $ propagateGError ((\(File arg1) (AsyncResult arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_copy_finish argPtr1 argPtr2 arg3) (toFile file) asyncResult)
fileMove :: (FileClass source, FileClass destination)
=> source
-> destination
-> [FileCopyFlags]
-> Maybe Cancellable
-> Maybe FileProgressCallback
-> IO Bool
fileMove source destination flags cancellable progressCallback =
withGObject (toFile source) $ \cSource ->
withGObject (toFile destination) $ \cDestination ->
maybeWith withGObject cancellable $ \cCancellable -> do
cProgressCallback <- maybe (return nullFunPtr) marshalFileProgressCallback progressCallback
propagateGError $ \cError -> do
ret <- g_file_move cSource
cDestination
(cFromFlags flags)
cCancellable
cProgressCallback
nullPtr
cError
when (cProgressCallback /= nullFunPtr) $
freeHaskellFunPtr cProgressCallback
return $ toBool ret
where _ = (\(File arg1) (File arg2) arg3 (Cancellable arg4) arg5 arg6 arg7 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg4 $ \argPtr4 ->g_file_move argPtr1 argPtr2 arg3 argPtr4 arg5 arg6 arg7)
fileMakeDirectory :: FileClass file
=> file
-> Maybe Cancellable
-> IO ()
fileMakeDirectory file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
propagateGError $ g_file_make_directory cFile cCancellable
return ()
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_make_directory argPtr1 argPtr2 arg3)
fileMakeDirectoryWithParents :: FileClass file
=> file
-> Maybe Cancellable
-> IO ()
fileMakeDirectoryWithParents file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
propagateGError $ g_file_make_directory_with_parents cFile cCancellable
return ()
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_make_directory_with_parents argPtr1 argPtr2 arg3)
fileMakeSymbolicLink :: FileClass file
=> file
-> String
-> Maybe Cancellable
-> IO ()
fileMakeSymbolicLink file symlinkValue cancellable =
withGObject (toFile file) $ \cFile ->
withUTFString symlinkValue $ \cSymlinkValue ->
maybeWith withGObject cancellable $ \cCancellable -> do
propagateGError $ g_file_make_symbolic_link cFile cSymlinkValue cCancellable
return ()
where _ = (\(File arg1) arg2 (Cancellable arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg3 $ \argPtr3 ->g_file_make_symbolic_link argPtr1 arg2 argPtr3 arg4)
newtype FileAttributeInfoList = FileAttributeInfoList (Ptr (FileAttributeInfoList))
takeFileAttributeInfoList :: Ptr FileAttributeInfoList
-> IO [FileAttributeInfo]
takeFileAttributeInfoList ptr =
do cInfos <- liftM castPtr $ (\ptr -> do {peekByteOff ptr 0 ::IO (Ptr ())}) ptr
cNInfos <- (\ptr -> do {peekByteOff ptr 4 ::IO CInt}) ptr
infos <- peekArray (fromIntegral cNInfos) cInfos
g_file_attribute_info_list_unref ptr
return infos
where _ = (\(FileAttributeInfoList arg1) -> g_file_attribute_info_list_unref arg1)
fileQuerySettableAttributes :: FileClass file
=> file
-> Maybe Cancellable
-> IO [FileAttributeInfo]
fileQuerySettableAttributes file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
ptr <- propagateGError $ g_file_query_settable_attributes cFile cCancellable
infos <- takeFileAttributeInfoList ptr
return infos
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_settable_attributes argPtr1 argPtr2 arg3)
fileQueryWritableNamespaces :: FileClass file
=> file
-> Maybe Cancellable
-> IO [FileAttributeInfo]
fileQueryWritableNamespaces file cancellable =
withGObject (toFile file) $ \cFile ->
maybeWith withGObject cancellable $ \cCancellable -> do
ptr <- propagateGError $ g_file_query_writable_namespaces cFile cCancellable
infos <- takeFileAttributeInfoList ptr
return infos
where _ = (\(File arg1) (Cancellable arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_file_query_writable_namespaces argPtr1 argPtr2 arg3)
foreign import ccall safe "g_file_new_for_path"
g_file_new_for_path :: ((Ptr CChar) -> (IO (Ptr File)))
foreign import ccall safe "g_file_new_for_uri"
g_file_new_for_uri :: ((Ptr CChar) -> (IO (Ptr File)))
foreign import ccall safe "g_file_new_for_commandline_arg"
g_file_new_for_commandline_arg :: ((Ptr CChar) -> (IO (Ptr File)))
foreign import ccall safe "g_file_parse_name"
g_file_parse_name :: ((Ptr CChar) -> (IO (Ptr File)))
foreign import ccall safe "g_file_equal"
g_file_equal :: ((Ptr File) -> ((Ptr File) -> (IO CInt)))
foreign import ccall safe "g_file_get_basename"
g_file_get_basename :: ((Ptr File) -> (IO (Ptr CChar)))
foreign import ccall safe "g_file_get_path"
g_file_get_path :: ((Ptr File) -> (IO (Ptr CChar)))
foreign import ccall safe "g_file_get_uri"
g_file_get_uri :: ((Ptr File) -> (IO (Ptr CChar)))
foreign import ccall safe "g_file_get_parse_name"
g_file_get_parse_name :: ((Ptr File) -> (IO (Ptr CChar)))
foreign import ccall safe "g_file_get_parent"
g_file_get_parent :: ((Ptr File) -> (IO (Ptr File)))
foreign import ccall safe "g_file_has_parent"
g_file_has_parent :: ((Ptr File) -> ((Ptr File) -> (IO CInt)))
foreign import ccall safe "g_file_get_child"
g_file_get_child :: ((Ptr File) -> ((Ptr CChar) -> (IO (Ptr File))))
foreign import ccall safe "g_file_get_child_for_display_name"
g_file_get_child_for_display_name :: ((Ptr File) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO (Ptr File)))))
foreign import ccall safe "g_file_has_prefix"
g_file_has_prefix :: ((Ptr File) -> ((Ptr File) -> (IO CInt)))
foreign import ccall safe "g_file_get_relative_path"
g_file_get_relative_path :: ((Ptr File) -> ((Ptr File) -> (IO (Ptr CChar))))
foreign import ccall safe "g_file_resolve_relative_path"
g_file_resolve_relative_path :: ((Ptr File) -> ((Ptr CChar) -> (IO (Ptr File))))
foreign import ccall safe "g_file_is_native"
g_file_is_native :: ((Ptr File) -> (IO CInt))
foreign import ccall safe "g_file_has_uri_scheme"
g_file_has_uri_scheme :: ((Ptr File) -> ((Ptr CChar) -> (IO CInt)))
foreign import ccall safe "g_file_get_uri_scheme"
g_file_get_uri_scheme :: ((Ptr File) -> (IO (Ptr CChar)))
foreign import ccall safe "g_file_read"
g_file_read :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInputStream)))))
foreign import ccall safe "g_file_read_async"
g_file_read_async :: ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ()))))))
foreign import ccall safe "g_file_read_finish"
g_file_read_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInputStream)))))
foreign import ccall safe "g_file_append_to"
g_file_append_to :: ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream))))))
foreign import ccall safe "g_file_create"
g_file_create :: ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream))))))
foreign import ccall safe "g_file_replace"
g_file_replace :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream))))))))
foreign import ccall safe "g_file_append_to_async"
g_file_append_to_async :: ((Ptr File) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ())))))))
foreign import ccall safe "g_file_append_to_finish"
g_file_append_to_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream)))))
foreign import ccall safe "g_file_create_async"
g_file_create_async :: ((Ptr File) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ())))))))
foreign import ccall safe "g_file_create_finish"
g_file_create_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream)))))
foreign import ccall safe "g_file_replace_async"
g_file_replace_async :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ())))))))))
foreign import ccall safe "g_file_replace_finish"
g_file_replace_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileOutputStream)))))
foreign import ccall safe "g_file_query_info"
g_file_query_info :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInfo)))))))
foreign import ccall safe "g_file_query_info_async"
g_file_query_info_async :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ()))))))))
foreign import ccall safe "g_file_query_info_finish"
g_file_query_info_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInfo)))))
foreign import ccall safe "g_file_query_exists"
g_file_query_exists :: ((Ptr File) -> ((Ptr Cancellable) -> (IO CInt)))
foreign import ccall safe "g_file_query_file_type"
g_file_query_file_type :: ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> (IO CInt))))
foreign import ccall safe "g_file_query_filesystem_info"
g_file_query_filesystem_info :: ((Ptr File) -> ((Ptr CChar) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInfo))))))
foreign import ccall safe "g_file_query_filesystem_info_async"
g_file_query_filesystem_info_async :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ())))))))
foreign import ccall safe "g_file_query_filesystem_info_finish"
g_file_query_filesystem_info_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileInfo)))))
foreign import ccall safe "g_file_query_default_handler"
g_file_query_default_handler :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr AppInfo)))))
foreign import ccall safe "g_file_find_enclosing_mount"
g_file_find_enclosing_mount :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr Mount)))))
foreign import ccall safe "g_file_find_enclosing_mount_async"
g_file_find_enclosing_mount_async :: ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ()))))))
foreign import ccall safe "g_file_find_enclosing_mount_finish"
g_file_find_enclosing_mount_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr Mount)))))
foreign import ccall safe "g_file_enumerate_children"
g_file_enumerate_children :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileEnumerator)))))))
foreign import ccall safe "g_file_enumerate_children_async"
g_file_enumerate_children_async :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ()))))))))
foreign import ccall safe "g_file_enumerate_children_finish"
g_file_enumerate_children_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr FileEnumerator)))))
foreign import ccall safe "g_file_set_display_name"
g_file_set_display_name :: ((Ptr File) -> ((Ptr CChar) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr File))))))
foreign import ccall safe "g_file_set_display_name_async"
g_file_set_display_name_async :: ((Ptr File) -> ((Ptr CChar) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ())))))))
foreign import ccall safe "g_file_set_display_name_finish"
g_file_set_display_name_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO (Ptr File)))))
foreign import ccall safe "g_file_delete"
g_file_delete :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "g_file_trash"
g_file_trash :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "g_file_copy"
g_file_copy :: ((Ptr File) -> ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr (CLLong -> (CLLong -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> ((Ptr (Ptr ())) -> (IO CInt))))))))
foreign import ccall safe "g_file_copy_async"
g_file_copy_async :: ((Ptr File) -> ((Ptr File) -> (CInt -> (CInt -> ((Ptr Cancellable) -> ((FunPtr (CLLong -> (CLLong -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> ((Ptr AsyncResult) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> (IO ()))))))))))
foreign import ccall safe "g_file_copy_finish"
g_file_copy_finish :: ((Ptr File) -> ((Ptr AsyncResult) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "g_file_move"
g_file_move :: ((Ptr File) -> ((Ptr File) -> (CInt -> ((Ptr Cancellable) -> ((FunPtr (CLLong -> (CLLong -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> ((Ptr (Ptr ())) -> (IO CInt))))))))
foreign import ccall safe "g_file_make_directory"
g_file_make_directory :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "g_file_make_directory_with_parents"
g_file_make_directory_with_parents :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "g_file_make_symbolic_link"
g_file_make_symbolic_link :: ((Ptr File) -> ((Ptr CChar) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO CInt)))))
foreign import ccall safe "g_file_attribute_info_list_unref"
g_file_attribute_info_list_unref :: ((Ptr FileAttributeInfoList) -> (IO ()))
foreign import ccall safe "g_file_query_settable_attributes"
g_file_query_settable_attributes :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileAttributeInfoList)))))
foreign import ccall safe "g_file_query_writable_namespaces"
g_file_query_writable_namespaces :: ((Ptr File) -> ((Ptr Cancellable) -> ((Ptr (Ptr ())) -> (IO (Ptr FileAttributeInfoList)))))