From: Andy S. <And...@co...> - 2010-08-15 19:11:26
|
diffing dir... Sun Aug 15 14:13:50 EDT 2010 Andy Stewart <laz...@gm...> * Update System.GIO.File module Ignore-this: ff018efa91ad990ddfdb017c1ede3e6a { hunk ./gio/System/GIO/File/File.chs 34 --- | GFile is a high level abstraction for manipulating files on a virtual file system. GFiles are +-- | 'File' is a high level abstraction for manipulating files on a virtual file system. 'File's are hunk ./gio/System/GIO/File/File.chs 36 --- GFile objects do not represent files, merely an identifier for a file. All file content I/O is +-- 'File' objects do not represent files, merely an identifier for a file. All file content I/O is hunk ./gio/System/GIO/File/File.chs 39 --- To construct a GFile, you can use: 'fileNewForPath' if +-- To construct a 'File', you can use: 'fileNewForPath' if hunk ./gio/System/GIO/File/File.chs 43 --- One way to think of a GFile is as an abstraction of a pathname. For normal files the system pathname --- is what is stored internally, but as GFiles are extensible it could also be something else that +-- One way to think of a 'File' is as an abstraction of a pathname. For normal files the system pathname +-- is what is stored internally, but as 'File's are extensible it could also be something else that hunk ./gio/System/GIO/File/File.chs 47 --- GFiles make up hierarchies of directories and files that correspond to the files on a --- filesystem. You can move through the file system with GFile using 'fileGetParent' to get an +-- 'File's make up hierarchies of directories and files that correspond to the files on a +-- filesystem. You can move through the file system with 'File' using 'fileGetParent' to get an hunk ./gio/System/GIO/File/File.chs 50 --- 'fileResolveRelativePath' to resolve a relative path between two GFiles. There can be multiple +-- 'fileResolveRelativePath' to resolve a relative path between two 'File's. There can be multiple hunk ./gio/System/GIO/File/File.chs 54 --- All GFiles have a basename (get with 'fileGetBasename'. These names are byte strings that are +-- All 'File's have a basename (get with 'fileGetBasename'. These names are byte strings that are hunk ./gio/System/GIO/File/File.chs 58 --- the GFileAttributeStandardDisplayName attribute with 'fileQueryInfo'. This is guaranteed to --- be in utf8 and can be used in a user interface. But always store the real basename or the GFile to +-- the 'FileAttributeStandardDisplayName' attribute with 'fileQueryInfo'. This is guaranteed to +-- be in utf8 and can be used in a user interface. But always store the real basename or the 'File' to hunk ./gio/System/GIO/File/File.chs 63 --- Using GFile as an identifier has the same weaknesses as using a path in that there may be multiple --- aliases for the same file. For instance, hard or soft links may cause two different GFiles to refer +-- Using 'File' as an identifier has the same weaknesses as using a path in that there may be multiple +-- aliases for the same file. For instance, hard or soft links may cause two different 'File's to refer hunk ./gio/System/GIO/File/File.chs 66 --- long names on Fat/NTFS, or bind mounts in Linux. If you want to check if two GFiles point to the --- same file you can query for the GFileAttributeIdFile attribute. Note that GFile does some +-- long names on Fat/NTFS, or bind mounts in Linux. If you want to check if two 'File's point to the +-- same file you can query for the 'FileAttributeIdFile' attribute. Note that 'File' does some hunk ./gio/System/GIO/File/File.chs 70 --- create different GFiles. +-- create different 'File's. hunk ./gio/System/GIO/File/File.chs 72 --- Many GFile operations have both synchronous and asynchronous versions to suit your +-- Many 'File' operations have both synchronous and asynchronous versions to suit your hunk ./gio/System/GIO/File/File.chs 74 --- function names. The asynchronous I/O functions call a GAsyncReadyCallback which is then used to --- finalize the operation, producing a GAsyncResult which is then passed to the function's matching +-- function names. The asynchronous I/O functions call a 'AsyncReadyCallback' which is then used to +-- finalize the operation, producing a 'AsyncResult' which is then passed to the function's matching hunk ./gio/System/GIO/File/File.chs 78 --- Some GFile operations do not have synchronous analogs, as they may take a very long time to finish, +-- Some 'File' operations do not have synchronous analogs, as they may take a very long time to finish, hunk ./gio/System/GIO/File/File.chs 83 --- One notable feature of GFiles are entity tags, or "etags" for short. Entity tags are somewhat like a +-- One notable feature of 'File's are entity tags, or "etags" for short. Entity tags are somewhat like a hunk ./gio/System/GIO/File/File.chs 89 + File(..), + FileClass, hunk ./gio/System/GIO/File/File.chs 93 - FileClass, + Offset, + FileInputStream, + FileInputStreamClass, + FileOutputStream, + FileOutputStreamClass, + InputStream, + InputStreamClass, + OutputStream, + OutputStreamClass, + BufferedInputStream, + BufferedInputStreamClass, + BufferedOutputStream, + BufferedOutputStreamClass, + MemoryInputStream, + MemoryInputStreamClass, + MemoryOutputStream, + MemoryOutputStreamClass, + FilterInputStream, + FilterInputStreamClass, + FilterOutputStream, + FilterOutputStreamClass, + DataInputStream, + DataInputStreamClass, + DataOutputStream, + DataOutputStreamClass, hunk ./gio/System/GIO/File/File.chs 120 - File(..), - FileQueryInfoFlags(..), - FileCreateFlags(..), - FileCopyFlags(..), - FileMonitorFlags(..), - FilesystemPreviewType(..), - FileType(..), + FileType (..), + FileCopyFlags (..), + FileQueryInfoFlags (..), + FileCreateFlags (..), + FileMonitorFlags (..), + MountMountFlags (..), + MountUnmountFlags (..), hunk ./gio/System/GIO/File/File.chs 193 - fileQueryWritableNamespaces + fileQueryWritableNamespaces, + + fileSetAttributesFromInfo, + fileSetAttributesFromInfoAsync, + fileSetAttributesFinish, + fileSetAttributeString, + fileSetAttributeByteString, + fileSetAttributeWord32, + fileSetAttributeInt32, + fileSetAttributeWord64, + fileSetAttributeInt64, + fileCopyAttributes, + + fileMonitorDirectory, + fileMonitorFile, +#if GLIB_CHECK_VERSION(2,18,0) + fileMonitor, +#endif + + fileMountMountable, + fileMountMountableFinish, +#if GLIB_CHECK_VERSION(2,22,0) + fileUnmountMountableWithOperation, + fileUnmountMountableWithOperationFinish, + fileEjectMountableWithOperation, + fileEjectMountableWithOperationFinish, + fileStartMountable, + fileStartMountableFinish, + fileStopMountable, + fileStopMountableFinish, + filePollMountable, + filePollMountableFinish, + fileMountEnclosingVolume, + fileMountEnclosingVolumeFinish, + fileSupportsThreadContexts, +#endif hunk ./gio/System/GIO/File/File.chs 232 -import qualified Data.ByteString as BS hunk ./gio/System/GIO/File/File.chs 233 - +import System.GIO.Enums +import System.GIO.File.FileAttribute hunk ./gio/System/GIO/File/File.chs 238 -import System.Glib.UTFString hunk ./gio/System/GIO/File/File.chs 239 - +import System.Glib.UTFString +{#import System.GIO.Async.AsyncResult#} hunk ./gio/System/GIO/File/File.chs 243 -import System.GIO.File.FileAttribute hunk ./gio/System/GIO/File/File.chs 244 -{# context lib = "gio" prefix = "g" #} - -{# enum GFileQueryInfoFlags as FileQueryInfoFlags {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} -instance Flags FileQueryInfoFlags - -{# enum GFileCreateFlags as FileCreateFlags {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} -instance Flags FileCreateFlags - -{# enum GFileCopyFlags as FileCopyFlags {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} -instance Flags FileCopyFlags +import qualified Data.ByteString as BS hunk ./gio/System/GIO/File/File.chs 246 -{# enum GFileMonitorFlags as FileMonitorFlags {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} -instance Flags FileMonitorFlags +{# context lib = "gio" prefix = "g" #} hunk ./gio/System/GIO/File/File.chs 248 -{# enum GFilesystemPreviewType as FilesystemPreviewType {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} +type Offset = {# type goffset #} hunk ./gio/System/GIO/File/File.chs 250 -{# enum GFileType as FileType {underscoreToCase} with prefix = "G" deriving (Eq, Ord, Bounded, Show, Typeable) #} +{#pointer GFileProgressCallback #} hunk ./gio/System/GIO/File/File.chs 253 -type CFileProgressCallback = {# type goffset #} -> {# type goffset #} -> Ptr () -> IO () -foreign import ccall "wrapper" - makeFileProgressCallback :: CFileProgressCallback - -> IO {# type GFileProgressCallback #} hunk ./gio/System/GIO/File/File.chs 254 -marshalFileProgressCallback :: FileProgressCallback -> IO {# type GFileProgressCallback #} +foreign import ccall "wrapper" mkFileProgressCallback :: + ({#type goffset #} -> {#type goffset #} -> Ptr () -> IO ()) -> IO GFileProgressCallback + +marshalFileProgressCallback :: FileProgressCallback -> IO GFileProgressCallback hunk ./gio/System/GIO/File/File.chs 259 - makeFileProgressCallback cFileProgressCallback - where cFileProgressCallback :: CFileProgressCallback - cFileProgressCallback cCurrentNumBytes cTotalNumBytes _ = do - fileProgressCallback (fromIntegral cCurrentNumBytes) - (fromIntegral cTotalNumBytes) + mkFileProgressCallback $ \ cCurrentNumBytes cTotalNumBytes _ -> do + fileProgressCallback [_$_] + (fromIntegral cCurrentNumBytes) + (fromIntegral cTotalNumBytes) hunk ./gio/System/GIO/File/File.chs 266 --- | Constructs a GFile for a given path. This operation never fails, but the returned object might not +-- | Constructs a 'File' for a given path. This operation never fails, but the returned object might not hunk ./gio/System/GIO/File/File.chs 270 - unsafePerformIO $ withUTFString path $ \cPath -> {# call file_new_for_path #} cPath >>= takeGObject + unsafePerformIO $ constructNewGObject mkFile $ [_$_] + withUTFString path $ \cPath -> {# call file_new_for_path #} cPath hunk ./gio/System/GIO/File/File.chs 273 --- | Constructs a GFile for a given URI. This operation never fails, but the returned object might not +-- | Constructs a 'File' for a given URI. This operation never fails, but the returned object might not hunk ./gio/System/GIO/File/File.chs 277 - unsafePerformIO $ withUTFString uri $ \cURI -> {# call file_new_for_uri #} cURI >>= takeGObject + unsafePerformIO $ constructNewGObject mkFile $ [_$_] + withUTFString uri $ \cURI -> {# call file_new_for_uri #} cURI [_$_] hunk ./gio/System/GIO/File/File.chs 280 --- | Creates a GFile with the given argument from the command line. The value of arg can be either a URI, +-- | Creates a 'File' with the given argument from the command line. The value of arg can be either a URI, hunk ./gio/System/GIO/File/File.chs 286 - unsafePerformIO $ withUTFString arg $ \cArg -> {# call file_new_for_commandline_arg #} cArg >>= takeGObject + unsafePerformIO $ constructNewGObject mkFile $ [_$_] + withUTFString arg $ \cArg -> {# call file_new_for_commandline_arg #} cArg [_$_] hunk ./gio/System/GIO/File/File.chs 289 --- | Constructs a GFile with the given 'name (i.e. something given by gFileGetParseName'. This +-- | Constructs a 'File' with the given name (i.e. something given by 'fileParseName'. This hunk ./gio/System/GIO/File/File.chs 294 - unsafePerformIO $ withUTFString parseName $ \cParseName -> {# call file_parse_name #} cParseName >>= takeGObject + unsafePerformIO $ constructNewGObject mkFile $ [_$_] + withUTFString parseName $ \cParseName -> {# call file_parse_name #} cParseName [_$_] hunk ./gio/System/GIO/File/File.chs 309 --- | Gets the base name (the last component of the path) for a given GFile. +-- | Gets the base name (the last component of the path) for a given 'File'. hunk ./gio/System/GIO/File/File.chs 316 --- name that you can get by requesting the GFileAttributeStandardDisplayName attribute with +-- name that you can get by requesting the 'FileAttributeStandardDisplayName' attribute with hunk ./gio/System/GIO/File/File.chs 322 - unsafePerformIO $ {# call file_get_basename #} (toFile file) >>= readUTFString + unsafePerformIO $ {# call file_get_basename #} (toFile file) >>= readCString hunk ./gio/System/GIO/File/File.chs 324 --- | Gets the local pathname for GFile, if one exists. +-- | Gets the local pathname for 'File', if one exists. hunk ./gio/System/GIO/File/File.chs 339 --- one can get the GFile back using 'fileParseName'. +-- one can get the 'File' back using 'fileParseName'. hunk ./gio/System/GIO/File/File.chs 341 --- This is generally used to show the GFile as a nice full-pathname kind of string in a user interface, +-- This is generally used to show the 'File' as a nice full-pathname kind of string in a user interface, hunk ./gio/System/GIO/File/File.chs 358 - unsafePerformIO $ {# call file_get_parent #} (toFile file) >>= maybePeek takeGObject + unsafePerformIO $ maybeNull (makeNewGObject mkFile) $ [_$_] + {# call file_get_parent #} (toFile file) [_$_] hunk ./gio/System/GIO/File/File.chs 377 --- Note that the file with that specific name might not exist, but you can still have a GFile that +-- Note that the file with that specific name might not exist, but you can still have a 'File' that hunk ./gio/System/GIO/File/File.chs 383 - unsafePerformIO $ + unsafePerformIO $ makeNewGObject mkFile $ hunk ./gio/System/GIO/File/File.chs 385 - {# call file_get_child #} (toFile file) cName >>= takeGObject + {# call file_get_child #} (toFile file) cName hunk ./gio/System/GIO/File/File.chs 388 --- fails, it returns 'Nothing' and error will be set. This is very useful when constructing a GFile for a +-- fails, it returns 'Nothing' and error will be set. This is very useful when constructing a 'File' for a hunk ./gio/System/GIO/File/File.chs 395 - unsafePerformIO $ + unsafePerformIO $ maybeNull (makeNewGObject mkFile) $ hunk ./gio/System/GIO/File/File.chs 397 - propagateGError ({# call file_get_child_for_display_name #} (toFile file) cDisplayName) >>= - maybePeek takeGObject + propagateGError ({# call file_get_child_for_display_name #} (toFile file) cDisplayName) hunk ./gio/System/GIO/File/File.chs 425 - unsafePerformIO $ + unsafePerformIO $ maybeNull (makeNewGObject mkFile) $ hunk ./gio/System/GIO/File/File.chs 427 - {# call file_resolve_relative_path #} (toFile file) cRelativePath >>= - maybePeek takeGObject + {# call file_resolve_relative_path #} (toFile file) cRelativePath hunk ./gio/System/GIO/File/File.chs 431 --- A native file s one expressed in the platform-native filename format, e.g. \"C:\\Windows\" or +-- A native file s one expressed in the platform-native filename format, e.g. \"C:\Windows\" or hunk ./gio/System/GIO/File/File.chs 436 --- filesystem (FUSE), in these cases this call will return @False@, but 'fileGetPath' will still +-- filesystem (FUSE), in these cases this call will return 'False', but 'fileGetPath' will still hunk ./gio/System/GIO/File/File.chs 445 --- | Checks to see if a 'GFile' has a given URI scheme. +-- | Checks to see if a 'File' has a given URI scheme. hunk ./gio/System/GIO/File/File.chs 454 --- | Gets the URI scheme for a GFile. RFC 3986 decodes the scheme as: +-- | Gets the URI scheme for a 'File'. RFC 3986 decodes the scheme as: hunk ./gio/System/GIO/File/File.chs 465 --- | Opens a file for reading. The result is a GFileInputStream that can be used to read the contents of +-- | Opens a file for reading. The result is a 'FileInputStream' that can be used to read the contents of hunk ./gio/System/GIO/File/File.chs 469 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 472 --- If the file does not exist, the GIoErrorNotFound error will be returned. If the file is a --- directory, the GIoErrorIsDirectory error will be returned. Other errors are possible too, and +-- If the file does not exist, the 'IoErrorNotFound' error will be returned. If the file is a +-- directory, the 'IoErrorIsDirectory' error will be returned. Other errors are possible too, and hunk ./gio/System/GIO/File/File.chs 476 -fileRead file (Just cancellable) = constructNewGObject mkFileInputStream $ - propagateGError $ {# call file_read #} (toFile file) cancellable -fileRead file Nothing = constructNewGObject mkFileInputStream $ - propagateGError $ {# call file_read #} (toFile file) (Cancellable nullForeignPtr) +fileRead file cancellable = + constructNewGObject mkFileInputStream $ + withGObject (toFile file) $ \cFile -> + maybeWith withGObject cancellable $ \cCancellable -> + propagateGError (g_file_read cFile cCancellable) [_$_] + where _ = {# call file_read #} hunk ./gio/System/GIO/File/File.chs 512 - propagateGError ({# call file_read_finish #} (toFile file) asyncResult) >>= takeGObject + constructNewGObject mkFileInputStream $ + propagateGError ({# call file_read_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 518 --- By default files created are generally readable by everyone, but if you pass GFileCreatePrivate +-- By default files created are generally readable by everyone, but if you pass 'FileCreatePrivate' hunk ./gio/System/GIO/File/File.chs 523 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 526 --- Some file systems don't allow all file names, and may return an GIoErrorInvalidFilename --- error. If the file is a directory the GIoErrorIsDirectory error will be returned. Other errors +-- Some file systems don't allow all file names, and may return an 'IoErrorInvalidFilename' +-- error. If the file is a directory the 'IoErrorIsDirectory' error will be returned. Other errors hunk ./gio/System/GIO/File/File.chs 535 + makeNewGObject mkFileOutputStream $ hunk ./gio/System/GIO/File/File.chs 538 - propagateGError (g_file_append_to cFile (cFromFlags flags) cCancellable) >>= - takeGObject + propagateGError (g_file_append_to cFile ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 543 --- By default files created are generally readable by everyone, but if you pass GFileCreatePrivate +-- By default files created are generally readable by everyone, but if you pass 'FileCreatePrivate' hunk ./gio/System/GIO/File/File.chs 548 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 551 --- If a file or directory with this name already exists the GIoErrorExists error will be +-- If a file or directory with this name already exists the 'IoErrorExists' error will be hunk ./gio/System/GIO/File/File.chs 553 --- GIoErrorInvalidFilename error, and if the name is to long GIoErrorFilenameTooLong will be +-- 'IoErrorInvalidFilename' error, and if the name is to long 'IoErrorFilenameTooLong' will be hunk ./gio/System/GIO/File/File.chs 561 + constructNewGObject mkFileOutputStream $ hunk ./gio/System/GIO/File/File.chs 564 - propagateGError (g_file_create cFile (cFromFlags flags) cCancellable) >>= - takeGObject + propagateGError (g_file_create cFile ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 574 --- By default files created are generally readable by everyone, but if you pass GFileCreatePrivate +-- By default files created are generally readable by everyone, but if you pass 'FileCreatePrivate' hunk ./gio/System/GIO/File/File.chs 579 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 583 --- file, and if they differ an GIoErrorWrongEtag error is returned. This generally means that the +-- file, and if they differ an 'IoErrorWrongEtag' error is returned. This generally means that the hunk ./gio/System/GIO/File/File.chs 585 --- 'fileOutputStreamGetEtag' after you've finished writing and closed the GFileOutputStream. +-- 'fileOutputStreamGetEtag' after you've finished writing and closed the 'FileOutputStream'. hunk ./gio/System/GIO/File/File.chs 589 --- overwriting it. If this fails a GIoErrorCantCreateBackup error will be returned. If you want to +-- overwriting it. If this fails a 'IoErrorCantCreateBackup' error will be returned. If you want to hunk ./gio/System/GIO/File/File.chs 592 --- If the file is a directory the GIoErrorIsDirectory error will be returned, and if the file is --- some other form of non-regular file then a GIoErrorNotRegularFile error will be returned. Some --- file systems don't allow all file names, and may return an GIoErrorInvalidFilename error, and if --- the name is to long GIoErrorFilenameTooLong will be returned. Other errors are possible too, +-- If the file is a directory the 'IoErrorIsDirectory' error will be returned, and if the file is +-- some other form of non-regular file then a 'IoErrorNotRegularFile' error will be returned. Some +-- file systems don't allow all file names, and may return an 'IoErrorInvalidFilename' error, and if +-- the name is to long 'IoErrorFilenameTooLong' will be returned. Other errors are possible too, hunk ./gio/System/GIO/File/File.chs 605 + makeNewGObject mkFileOutputStream $ hunk ./gio/System/GIO/File/File.chs 612 - (cFromFlags flags) cCancellable) >>= - takeGObject + ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 633 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 646 - propagateGError ({# call file_append_to_finish #} (toFile file) asyncResult) >>= takeGObject + constructNewGObject mkFileOutputStream $ + propagateGError ({# call file_append_to_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 668 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 681 - propagateGError ({# call file_create_finish #} (toFile file) asyncResult) >>= takeGObject + constructNewGObject mkFileOutputStream $ + propagateGError ({# call file_create_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 708 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 721 - propagateGError ({# call file_replace_finish #} (toFile file) asyncResult) >>= takeGObject + constructNewGObject mkFileOutputStream $ + propagateGError ({# call file_replace_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 724 --- | Gets the requested information about specified file. The result is a 'GFileInfo' object that contains +-- | Gets the requested information about specified file. The result is a 'FileInfo' object that contains hunk ./gio/System/GIO/File/File.chs 732 --- are available as defines, like 'GFileAttributeStandardName'. +-- are available as defines, like 'FileAttributeStandardName'. hunk ./gio/System/GIO/File/File.chs 735 --- from another thread. If the operation was cancelled, the error 'GIoErrorCancelled' will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 739 --- information about the symlink itself. However if you pass 'GFileQueryInfoNofollowSymlinks' in +-- information about the symlink itself. However if you pass 'FileQueryInfoNofollowSymlinks' in hunk ./gio/System/GIO/File/File.chs 743 --- If the file does not exist, the 'GIoErrorNotFound' error will be returned. Other errors are +-- If the file does not exist, the 'IoErrorNotFound' error will be returned. Other errors are hunk ./gio/System/GIO/File/File.chs 752 + makeNewGObject mkFileInfo $ hunk ./gio/System/GIO/File/File.chs 756 - propagateGError (g_file_query_info cFile cAttributes (cFromFlags flags) cCancellable) >>= - takeGObject + propagateGError (g_file_query_info cFile cAttributes ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 759 --- | Asynchronously gets the requested information about specified file. The --- result is a 'GFileInfo' object that contains key-value attributes (such as --- type or size for the file). --- [_$_] --- For more details, see 'fileQueryInfo' which is the synchronous version of --- this call. --- [_$_] +-- | Asynchronously gets the requested information about specified file. The result is a 'FileInfo' object +-- that contains key-value attributes (such as type or size for the file). +-- [_$_] +-- For more details, see 'fileQueryInfo' which is the synchronous version of this call. +-- [_$_] hunk ./gio/System/GIO/File/File.chs 781 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 794 - propagateGError ({#call file_query_info_finish #} (toFile file) asyncResult) >>= takeGObject + constructNewGObject mkFileInfo $ + propagateGError ({#call file_query_info_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 809 --- 'fileCreate' which will either atomically create the file or fail with a GIoErrorExists error. +-- 'fileCreate' which will either atomically create the file or fail with a 'IoErrorExists' error. hunk ./gio/System/GIO/File/File.chs 818 - -> IO Bool + -> Bool hunk ./gio/System/GIO/File/File.chs 820 + unsafePerformIO $ hunk ./gio/System/GIO/File/File.chs 827 --- | Utility function to inspect the GFileType of a file. This is implemented using 'fileQueryInfo' +-- | Utility function to inspect the 'FileType' of a file. This is implemented using 'fileQueryInfo' hunk ./gio/System/GIO/File/File.chs 835 - -> IO FileType + -> FileType hunk ./gio/System/GIO/File/File.chs 837 - liftM (toEnum . fromIntegral) $ + (toEnum . fromIntegral) $ + unsafePerformIO $ [_$_] hunk ./gio/System/GIO/File/File.chs 841 - (g_file_query_file_type cFile (cFromFlags flags) cCancellable) + (g_file_query_file_type cFile ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 851 --- wildcard "*" means all attributes, and a wildcard like "fs:*" means all attributes in the fs +-- wildcard \"*\" means all attributes, and a wildcard like "fs:*" means all attributes in the fs hunk ./gio/System/GIO/File/File.chs 854 --- 'FILEAttributeFilesystemFree (Number Of Bytes Available)', and GFileAttributeFilesystemType +-- 'FILEAttributeFilesystemFree (Number Of Bytes Available)', and 'FileAttributeFilesystemType' hunk ./gio/System/GIO/File/File.chs 858 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 861 --- If the file does not exist, the GIoErrorNotFound error will be returned. Other errors are +-- If the file does not exist, the 'IoErrorNotFound' error will be returned. Other errors are hunk ./gio/System/GIO/File/File.chs 869 + makeNewGObject mkFileInfo $ hunk ./gio/System/GIO/File/File.chs 873 - propagateGError (g_file_query_filesystem_info cFile cAttributes cCancellable) >>= - takeGObject + propagateGError (g_file_query_filesystem_info cFile cAttributes cCancellable) hunk ./gio/System/GIO/File/File.chs 877 --- on. The result is a GFileInfo object that contains key-value attributes (such as type or size for +-- on. The result is a 'FileInfo' object that contains key-value attributes (such as type or size for hunk ./gio/System/GIO/File/File.chs 910 - propagateGError ({# call file_query_filesystem_info_finish #} (toFile file) asyncResult) >>= - takeGObject + constructNewGObject mkFileInfo $ + propagateGError ({# call file_query_filesystem_info_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 913 --- | Returns the GAppInfo that is registered as the default application to handle the file specified by +-- | Returns the 'AppInfo' that is registered as the default application to handle the file specified by hunk ./gio/System/GIO/File/File.chs 917 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 924 + makeNewGObject mkAppInfo $ hunk ./gio/System/GIO/File/File.chs 927 - propagateGError (g_file_query_default_handler cFile cCancellable) >>= - takeGObject + propagateGError (g_file_query_default_handler cFile cCancellable) hunk ./gio/System/GIO/File/File.chs 930 --- | Gets a GMount for the GFile. +-- | Gets a 'Mount' for the 'File'. hunk ./gio/System/GIO/File/File.chs 932 --- If the GFileIface for file does not have a mount (e.g. possibly a remote share), error will be set --- to GIoErrorNotFound and 'Nothing' will be returned. +-- If the 'FileIface' for file does not have a mount (e.g. possibly a remote share), error will be set +-- to 'IoErrorNotFound' and 'Nothing' will be returned. hunk ./gio/System/GIO/File/File.chs 936 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 943 + makeNewGObject mkMount $ hunk ./gio/System/GIO/File/File.chs 946 - propagateGError (g_file_find_enclosing_mount cFile cCancellable) >>= - takeGObject + propagateGError (g_file_find_enclosing_mount cFile cCancellable) hunk ./gio/System/GIO/File/File.chs 978 - propagateGError ({# call file_find_enclosing_mount_finish #} (toFile file) asyncResult) >>= - takeGObject + makeNewGObject mkMount $ + propagateGError ({# call file_find_enclosing_mount_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 981 --- | Gets the requested information about the files in a directory. The result is a 'GFileEnumerator' --- object that will give out 'GFileInfo' objects for all the files in the directory. +-- | Gets the requested information about the files in a directory. The result is a 'FileEnumerator' +-- object that will give out 'FileInfo' objects for all the files in the directory. hunk ./gio/System/GIO/File/File.chs 989 --- are available as defines, like 'GFileAttributeStandardName'. +-- are available as defines, like 'FileAttributeStandardName'. hunk ./gio/System/GIO/File/File.chs 991 --- If cancellable is not @Nothing@, then the operation can be cancelled by triggering the cancellable object --- from another thread. If the operation was cancelled, the error 'GIoErrorCancelled' will be +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 995 --- If the file does not exist, the 'GIoErrorNotFound' error will be returned. If the file is not a --- directory, the 'GFileErrorNotdir' error will be returned. Other errors are possible too. +-- If the file does not exist, the 'IoErrorNotFound' error will be returned. If the file is not a +-- directory, the 'FileErrorNotdir' error will be returned. Other errors are possible too. hunk ./gio/System/GIO/File/File.chs 1004 + makeNewGObject mkFileEnumerator $ hunk ./gio/System/GIO/File/File.chs 1008 - propagateGError (g_file_enumerate_children cFile cAttributes (cFromFlags flags) cCancellable) >>= - takeGObject + propagateGError (g_file_enumerate_children cFile cAttributes ((fromIntegral . fromFlags) flags) cCancellable) hunk ./gio/System/GIO/File/File.chs 1012 --- GFileEnumerator object that will give out GFileInfo objects for all the files in the directory. +-- 'FileEnumerator' object that will give out 'FileInfo' objects for all the files in the directory. hunk ./gio/System/GIO/File/File.chs 1033 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 1046 - propagateGError ({# call file_enumerate_children_finish #} (toFile file) asyncResult) >>= - takeGObject + constructNewGObject mkFileEnumerator $ + propagateGError ({# call file_enumerate_children_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 1055 --- (GFileAttributeStandardEditName) should be used as the initial value in the rename widget, and +-- ('FileAttributeStandardEditName') should be used as the initial value in the rename widget, and hunk ./gio/System/GIO/File/File.chs 1061 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1069 + makeNewGObject mkFile $ hunk ./gio/System/GIO/File/File.chs 1073 - propagateGError (g_file_set_display_name cFile cDisplayName cCancellable) >>= - takeGObject + propagateGError (g_file_set_display_name cFile cDisplayName cCancellable) hunk ./gio/System/GIO/File/File.chs 1076 --- | Asynchronously sets the display name for a given GFile. +-- | Asynchronously sets the display name for a given 'File'. hunk ./gio/System/GIO/File/File.chs 1108 - propagateGError ({# call file_set_display_name_finish #} (toFile file) asyncResult) >>= - takeGObject + makeNewGObject mkFile $ + propagateGError ({# call file_set_display_name_finish #} (toFile file) asyncResult) hunk ./gio/System/GIO/File/File.chs 1114 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1128 --- GIoErrorNotSupported error. +-- 'IoErrorNotSupported' error. hunk ./gio/System/GIO/File/File.chs 1131 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1146 --- If the flag GFileCopyOverwrite is specified an already existing destination file is overwritten. +-- If the flag 'FileCopyOverwrite' is specified an already existing destination file is overwritten. hunk ./gio/System/GIO/File/File.chs 1148 --- If the flag GFileCopyNofollowSymlinks is specified then symlinks will be copied as symlinks, +-- If the flag 'FileCopyNofollowSymlinks' is specified then symlinks will be copied as symlinks, hunk ./gio/System/GIO/File/File.chs 1152 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1156 --- GFileProgressCallback function. @progressCallbackData@ will be passed to this function. It is +-- 'FileProgressCallback' function. @progressCallbackData@ will be passed to this function. It is hunk ./gio/System/GIO/File/File.chs 1160 --- If the source file does not exist then the GIoErrorNotFound error is returned, independent on +-- If the source file does not exist then the 'IoErrorNotFound' error is returned, independent on hunk ./gio/System/GIO/File/File.chs 1163 --- If GFileCopyOverwrite is not specified and the target exists, then the error GIoErrorExists is +-- If 'FileCopyOverwrite' is not specified and the target exists, then the error 'IoErrorExists' is hunk ./gio/System/GIO/File/File.chs 1166 --- If trying to overwrite a file over a directory the GIoErrorIsDirectory error is returned. If --- trying to overwrite a directory with a directory the GIoErrorWouldMerge error is returned. +-- If trying to overwrite a file over a directory the 'IoErrorIsDirectory' error is returned. If +-- trying to overwrite a directory with a directory the 'IoErrorWouldMerge' error is returned. hunk ./gio/System/GIO/File/File.chs 1169 --- If the source is a directory and the target does not exist, or GFileCopyOverwrite is specified --- and the target is a file, then the GIoErrorWouldRecurse error is returned. +-- If the source is a directory and the target does not exist, or 'FileCopyOverwrite' is specified +-- and the target is a file, then the 'IoErrorWouldRecurse' error is returned. hunk ./gio/System/GIO/File/File.chs 1172 --- If you are interested in copying the GFile object itself (not the on-disk file), see 'fileDup'. +-- If you are interested in copying the 'File' object itself (not the on-disk file), see 'fileDup'. hunk ./gio/System/GIO/File/File.chs 1188 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 1226 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 1248 --- If the flag GFileCopyOverwrite is specified an already existing destination file is overwritten. +-- If the flag 'FileCopyOverwrite' is specified an already existing destination file is overwritten. hunk ./gio/System/GIO/File/File.chs 1250 --- If the flag GFileCopyNofollowSymlinks is specified then symlinks will be copied as symlinks, +-- If the flag 'FileCopyNofollowSymlinks' is specified then symlinks will be copied as symlinks, hunk ./gio/System/GIO/File/File.chs 1254 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1258 --- GFileProgressCallback function. @progressCallbackData@ will be passed to this function. It is +-- 'FileProgressCallback' function. @progressCallbackData@ will be passed to this function. It is hunk ./gio/System/GIO/File/File.chs 1262 --- If the source file does not exist then the GIoErrorNotFound error is returned, independent on +-- If the source file does not exist then the 'IoErrorNotFound' error is returned, independent on hunk ./gio/System/GIO/File/File.chs 1265 --- If GFileCopyOverwrite is not specified and the target exists, then the error GIoErrorExists is +-- If 'FileCopyOverwrite' is not specified and the target exists, then the error 'IoErrorExists' is hunk ./gio/System/GIO/File/File.chs 1268 --- If trying to overwrite a file over a directory the GIoErrorIsDirectory error is returned. If --- trying to overwrite a directory with a directory the GIoErrorWouldMerge error is returned. +-- If trying to overwrite a file over a directory the 'IoErrorIsDirectory' error is returned. If +-- trying to overwrite a directory with a directory the 'IoErrorWouldMerge' error is returned. hunk ./gio/System/GIO/File/File.chs 1271 --- If the source is a directory and the target does not exist, or GFileCopyOverwrite is specified --- and the target is a file, then the GIoErrorWouldRecurse error may be returned (if the native +-- If the source is a directory and the target does not exist, or 'FileCopyOverwrite' is specified +-- and the target is a file, then the 'IoErrorWouldRecurse' error may be returned (if the native hunk ./gio/System/GIO/File/File.chs 1289 - (cFromFlags flags) + ((fromIntegral . fromFlags) flags) hunk ./gio/System/GIO/File/File.chs 1300 --- directory of the path or URI given by the GFile. To recursively create directories, see +-- directory of the path or URI given by the 'File'. To recursively create directories, see hunk ./gio/System/GIO/File/File.chs 1302 --- exist, setting error to GIoErrorNotFound. If the file system doesn't support creating --- directories, this function will fail, setting error to GIoErrorNotSupported. +-- exist, setting error to 'IoErrorNotFound'. If the file system doesn't support creating +-- directories, this function will fail, setting error to 'IoErrorNotSupported'. hunk ./gio/System/GIO/File/File.chs 1305 --- For a local GFile the newly created directory will have the default (current) ownership and +-- For a local 'File' the newly created directory will have the default (current) ownership and hunk ./gio/System/GIO/File/File.chs 1309 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1325 --- GIoErrorNotSupported. +-- 'IoErrorNotSupported'. hunk ./gio/System/GIO/File/File.chs 1327 --- For a local GFile the newly created directories will have the default (current) ownership and +-- For a local 'File' the newly created directories will have the default (current) ownership and hunk ./gio/System/GIO/File/File.chs 1331 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1348 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1381 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1399 --- from another thread. If the operation was cancelled, the error GIoErrorCancelled will be +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be hunk ./gio/System/GIO/File/File.chs 1413 +-- | Tries to set all attributes in the 'FileInfo' on the target values, not stopping on the first error. +-- [_$_] +-- If there is any error during this operation then error will be set to the first error. Error on +-- particular fields are flagged by setting the "status" field in the attribute value to +-- 'FileAttributeStatusErrorSetting', which means you can also detect further errors. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributesFromInfo :: FileClass file => file + -> FileInfo + -> [FileQueryInfoFlags] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if there was any error, 'False' otherwise. [_$_] +fileSetAttributesFromInfo file fileInfo flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withGObject (toFileInfo fileInfo) $ \cFileInfo -> + maybeWith withGObject cancellable $ \cCancellable -> + propagateGError (g_file_set_attributes_from_info cFile cFileInfo ((fromIntegral . fromFlags) flags) cCancellable) + where _ = {# call g_file_set_attributes_from_info #} + +-- | Asynchronously sets the attributes of file with info. +-- [_$_] +-- For more details, see 'fileSetAttributesFromInfo' which is the synchronous version of this +-- call. +-- [_$_] +-- When the operation is finished, callback will be called. You can then call +-- 'fileSetAttributesFinish' to get the result of the operation. +fileSetAttributesFromInfoAsync :: FileClass file => file + -> FileInfo + -> [FileQueryInfoFlags] + -> Int -- ^ @ioPriority@ the I/O priority of the request. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback + -> IO () -- ^ returns 'True' if there was any error, 'False' otherwise. [_$_] +fileSetAttributesFromInfoAsync file fileInfo flags ioPriority cancellable callback = + withGObject (toFile file) $ \cFile -> + withGObject (toFileInfo fileInfo) $ \cFileInfo -> + maybeWith withGObject cancellable $ \cCancellable -> do + cCallback <- marshalAsyncReadyCallback callback + g_file_set_attributes_async [_$_] + cFile [_$_] + cFileInfo [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromIntegral ioPriority) + cCancellable + cCallback + (castFunPtrToPtr cCallback) + where _ = {# call g_file_set_attributes_async #} + +-- | Finishes setting an attribute started in 'fileSetAttributesAsync'. +fileSetAttributesFinish :: FileClass file + => file + -> AsyncResult + -> FileInfo + -> IO Bool -- ^ returns 'True' if the attributes were set correctly, 'False' otherwise. [_$_] +fileSetAttributesFinish file asyncResult fileInfo = + liftM toBool $ + withGObject (toFileInfo fileInfo) $ \cFileInfo -> + propagateGError ({# call g_file_set_attributes_finish #} (toFile file) asyncResult cFileInfo) + +-- | Sets attribute of type 'FileAttributeTypeString' to value. If attribute is of a different type, +-- this operation will fail. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeString :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> String -- ^ @value@ a string containing the attribute's value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeString file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withUTFString attribute $ \ attributePtr -> [_$_] + withUTFString value $ \ valuePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_string [_$_] + cFile [_$_] + attributePtr + valuePtr + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_string #} + +-- | Sets attribute of type 'FileAttributeTypeByteString' to value. If attribute is of a different +-- type, this operation will fail, returning 'False'. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeByteString :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> String -- ^ @value@ a string containing the attribute's value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeByteString file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withCString attribute $ \ attributePtr -> [_$_] + withCString value $ \ valuePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_byte_string [_$_] + cFile [_$_] + attributePtr + valuePtr + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_byte_string #} + +-- | Sets attribute of type 'FileAttributeTypeUint32' to value. If attribute is of a different type, +-- this operation will fail. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeWord32 :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> Word32 -- ^ @value@ a Word32 containing the attribute's new value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeWord32 file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withUTFString attribute $ \ attributePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_uint32 [_$_] + cFile [_$_] + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_uint32 #} + +-- | Sets attribute of type 'FileAttributeTypeInt32' to value. If attribute is of a different type, +-- this operation will fail. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeInt32 :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> Int32 -- ^ @value@ a Int32 containing the attribute's new value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeInt32 file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withUTFString attribute $ \ attributePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_int32 [_$_] + cFile [_$_] + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_int32 #} + +-- | Sets attribute of type 'FileAttributeTypeUint64' to value. If attribute is of a different type, +-- this operation will fail. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeWord64 :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> Word64 -- ^ @value@ a Word64 containing the attribute's new value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeWord64 file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withUTFString attribute $ \ attributePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_uint64 [_$_] + cFile [_$_] + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_uint64 #} + +-- | Sets attribute of type 'FileAttributeTypeInt64' to value. If attribute is of a different type, +-- this operation will fail. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be +-- returned. +fileSetAttributeInt64 :: FileClass file => file + -> String -- ^ @attribute@ a string containing the attribute's name. [_$_] + -> Int64 -- ^ @value@ a Int64 containing the attribute's new value. [_$_] + -> [FileQueryInfoFlags] -- ^ @flags@ 'FileQueryInfoFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] +fileSetAttributeInt64 file attribute value flags cancellable = + liftM toBool $ + withGObject (toFile file) $ \cFile -> + withUTFString attribute $ \ attributePtr -> [_$_] + maybeWith withGObject cancellable $ \cCancellable -> do + propagateGError (g_file_set_attribute_int64 [_$_] + cFile [_$_] + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + cCancellable) + where _ = {# call g_file_set_attribute_int64 #} + +-- | Copies the file attributes from source to destination. +-- [_$_] +-- Normally only a subset of the file attributes are copied, those that are copies in a normal file +-- copy operation (which for instance does not include e.g. owner). However if 'FileCopyAllMetadata' +-- is specified in flags, then all the metadata that is possible to copy is copied. This is useful when +-- implementing move by copy + delete source. +fileCopyAttributes :: (FileClass source, FileClass destination) [_$_] + => source -- ^ @source@ a 'File' with attributes. [_$_] + -> destination -- ^ @destination@ a 'File' to copy attributes to. [_$_] + -> [FileCopyFlags] -- ^ @flags@ a set of 'FileCopyFlags'. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' if the attributes were copied successfully, 'False' otherwise. +fileCopyAttributes source destination flags cancellable = [_$_] + liftM toBool $ + withGObject (toFile source) $ \cSource -> + withGObject (toFile destination) $ \cDestination -> + maybeWith withGObject cancellable $ \cCancellable -> + propagateGError (g_file_copy_attributes cSource cDestination ((fromIntegral . fromFlags) flags) cCancellable) + where _ = {# call g_file_copy_attributes #} + +-- | Obtains a directo... [truncated message content] |