gnomevfs-0.11.0: Binding to the GNOME Virtual File System library.Source codeContentsIndex
System.Gnome.VFS.Xfer
Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net
Contents
Types
Operations
Description
Synopsis
data XferProgressInfo = XferProgressInfo {
xferProgressInfoVFSStatus :: Result
xferProgressInfoPhase :: XferPhase
xferProgressInfoSourceName :: Maybe String
xferProgressInfoTargetName :: Maybe String
xferProgressInfoFileIndex :: Word
xferProgressInfoFilesTotal :: Word
xferProgressInfoBytesTotal :: FileSize
xferProgressInfoFileSize :: FileSize
xferProgressInfoBytesCopied :: FileSize
xferProgressInfoTotalBytesCopied :: FileSize
xferProgressInfoTopLevelItem :: Bool
}
data XferOptions
= XferFollowLinks
| XferRecursive
| XferSamefs
| XferDeleteItems
| XferEmptyDirectories
| XferNewUniqueDirectory
| XferRemovesource
| XferUseUniqueNames
| XferLinkItems
| XferFollowLinksRecursive
| XferTargetDefaultPerms
data XferOverwriteMode
= XferOverwriteModeAbort
| XferOverwriteModeReplace
| XferOverwriteModeSkip
data XferErrorAction
= XferErrorActionAbort
| XferErrorActionRetry
| XferErrorActionSkip
data XferOverwriteAction
= XferOverwriteActionAbort
| XferOverwriteActionReplace
| XferOverwriteActionReplaceAll
| XferOverwriteActionSkip
| XferOverwriteActionSkipAll
type XferProgressCallback = XferProgressInfo -> IO Bool
type XferErrorCallback = XferProgressInfo -> IO XferErrorAction
type XferOverwriteCallback = XferProgressInfo -> IO XferOverwriteAction
type XferDuplicateCallback = XferProgressInfo -> String -> Int -> IO (Maybe String)
xferURI :: URI -> URI -> [XferOptions] -> Maybe XferProgressCallback -> Maybe XferErrorCallback -> Either XferOverwriteMode XferOverwriteCallback -> Maybe XferDuplicateCallback -> IO ()
xferURIList :: [(URI, URI)] -> [XferOptions] -> Maybe XferProgressCallback -> Maybe XferErrorCallback -> Either XferOverwriteMode XferOverwriteCallback -> Maybe XferDuplicateCallback -> IO ()
xferDeleteList :: [URI] -> [XferOptions] -> Maybe XferProgressCallback -> Maybe XferErrorCallback -> IO ()
Types
data XferProgressInfo Source
Constructors
XferProgressInfo
xferProgressInfoVFSStatus :: Resultcurrent VFS status
xferProgressInfoPhase :: XferPhasephase of the transfer
xferProgressInfoSourceName :: Maybe Stringcurrently transferring source URI
xferProgressInfoTargetName :: Maybe Stringcurrently transferring target URI
xferProgressInfoFileIndex :: Wordindex of the file currently being transferred
xferProgressInfoFilesTotal :: Wordtotal number of files being transferred
xferProgressInfoBytesTotal :: FileSizetotal size of all files in bytes
xferProgressInfoFileSize :: FileSizesize of the file currently being transferred
xferProgressInfoBytesCopied :: FileSizenumber of bytes already transferred in the current file
xferProgressInfoTotalBytesCopied :: FileSizetotal number of bytes already transferred
xferProgressInfoTopLevelItem :: BoolTrue if the file being transferred is a top-level item; False if it is inside a directory
data XferOptions Source
Options controlling how the System.Gnome.VFS.Xfer.xferURI and related functions behave.
Constructors
XferFollowLinks
XferRecursive
XferSamefs
XferDeleteItems
XferEmptyDirectories
XferNewUniqueDirectory
XferRemovesource
XferUseUniqueNames
XferLinkItems
XferFollowLinksRecursive
XferTargetDefaultPerms
data XferOverwriteMode Source
Constructors
XferOverwriteModeAbort
XferOverwriteModeReplace
XferOverwriteModeSkip
data XferErrorAction Source
Constructors
XferErrorActionAbort
XferErrorActionRetry
XferErrorActionSkip
data XferOverwriteAction Source
Constructors
XferOverwriteActionAbort
XferOverwriteActionReplace
XferOverwriteActionReplaceAll
XferOverwriteActionSkip
XferOverwriteActionSkipAll
type XferProgressCallback = XferProgressInfo -> IO BoolSource

The type of the first callback that is passed to System.Gnome.VFS.Xfer.xferURI and related functions. This callback will be called periodically during transfers that are progressing normally.

The callback must return False to abort the transfer, or True otherwise.

type XferErrorCallback = XferProgressInfo -> IO XferErrorActionSource

The type of the second callback that is passed to System.Gnome.VFS.Xfer.xferURI. This callback will be called whenever an error occurs.

The callback must return the action to be performed in response to the error.

type XferOverwriteCallback = XferProgressInfo -> IO XferOverwriteActionSource

The type of the third callback that is passed to System.Gnome.VFS.Xfer.xferURI. This callback will be called when a file would be overwritten.

The callback must return the action to be performed when the target file already exists.

type XferDuplicateCallback = XferProgressInfo -> String -> Int -> IO (Maybe String)Source

The type of the fourth callback that is passed to System.Gnome.VFS.Xfer.xferURI. This callback will be called when a duplicate filename is found.

The parameters, from left to right, are: * info - information about the progress of the current transfer, * duplicateName - the name of the target file, * duplicateCount - the number of duplicates that exist.

The callback must return the new filename that should be used, or Nothing to abort.

Operations
xferURISource
:: URIsourceURI - the source URI
-> URItargetURI - the target URI
-> [XferOptions]options -
-> Maybe XferProgressCallbackprogressCallback -
-> Maybe XferErrorCallbackerrorCallback -
-> Either XferOverwriteMode XferOverwriteCallbackoverwriteOpt -
-> Maybe XferDuplicateCallbackduplicateCallback -
-> IO ()
Transfer the file located at sourceURI to targetURI, using the specified options and callbacks.
xferURIListSource
:: [(URI, URI)]sourceTargetURIList -
-> [XferOptions]options -
-> Maybe XferProgressCallbackprogressCallback -
-> Maybe XferErrorCallbackerrorCallback -
-> Either XferOverwriteMode XferOverwriteCallbackoverwriteOpt -
-> Maybe XferDuplicateCallbackduplicateCallback -
-> IO ()
For each pair in sourceTargetURIList, transfer the file at the first URI to the second URI.
xferDeleteListSource
:: [URI]sourceURIList -
-> [XferOptions]options -
-> Maybe XferProgressCallbackprogressCallback -
-> Maybe XferErrorCallbackerrorCallback -
-> IO ()
Delete the files at the URIs in sourceURIList.
Produced by Haddock version 2.6.1