gio-0.12.4: Binding to the GIO.

Portability | portable (depends on GHC)
Stability | alpha
Maintainer | gtk2hs-devel@lists.sourceforge.net
Safe Haskell | None

System.GIO.File.FileMonitor

Contents

- Details
- Types
- Enums
- Methods
- Attributes
- Signals

Description

Synopsis

- newtype FileMonitor = FileMonitor (ForeignPtr FileMonitor)
- class GObjectClass o => FileMonitorClass o
- data FileMonitorEvent
  - = FileMonitorEventChanged
  - | FileMonitorEventChangesDoneHint
  - | FileMonitorEventDeleted
  - | FileMonitorEventCreated
  - | FileMonitorEventAttributeChanged
  - | FileMonitorEventPreUnmount
  - | FileMonitorEventUnmounted
  - | FileMonitorEventMoved
- fileMonitorCancel :: FileMonitorClass monitor => monitor -> IO Bool
- fileMonitorIsCancelled :: FileMonitorClass monitor => monitor -> IO Bool
- fileMonitorCancelled :: FileMonitorClass monitor => ReadAttr monitor Bool
- fileMonitorRateLimit :: FileMonitorClass monitor => Attr monitor Int
- fileMonitorChanged :: FileMonitorClass monitor => Signal monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())

# Details

Monitors a file or directory for changes.

To obtain a `FileMonitor` for a file or directory, use `fileMonitor`, or `fileMonitorDirectory` .

To get informed about changes to the file or directory you are monitoring, connect to the changed signal. The signal will be emitted in the thread-default main context of the thread that the monitor was created in (though if the global default main context is blocked, this may cause notifications to be blocked even if the thread-default context is still running).

# Types

newtype FileMonitor

Constructors

FileMonitor (ForeignPtr FileMonitor) |

Instances

Eq FileMonitor |
Ord FileMonitor |
GObjectClass FileMonitor |
FileMonitorClass FileMonitor |

class GObjectClass o => FileMonitorClass o

Instances

FileMonitorClass FileMonitor |

# Enums

data FileMonitorEvent

Specifies what type of event a monitor event is.

Constructors

FileMonitorEventChanged |
FileMonitorEventChangesDoneHint |
FileMonitorEventDeleted |
FileMonitorEventCreated |
FileMonitorEventAttributeChanged |
FileMonitorEventPreUnmount |
FileMonitorEventUnmounted |
FileMonitorEventMoved |

Instances

Bounded FileMonitorEvent |
Enum FileMonitorEvent |
Eq FileMonitorEvent |
Ord FileMonitorEvent |
Show FileMonitorEvent |
Typeable FileMonitorEvent |

# Methods

fileMonitorCancel

Arguments

:: FileMonitorClass monitor |
=> monitor |
-> IO Bool | returns `True` if monitor was cancelled.

Cancels a file monitor.

fileMonitorIsCancelled

Arguments

:: FileMonitorClass monitor |
=> monitor |
-> IO Bool | returns `True` if monitor is canceled. `False` otherwise.

Returns whether the monitor is canceled.

# Attributes

fileMonitorCancelled :: FileMonitorClass monitor => ReadAttr monitor Bool

Whether the monitor has been cancelled.

Default value: `False`

fileMonitorRateLimit :: FileMonitorClass monitor => Attr monitor Int

The limit of the monitor to watch for changes, in milliseconds.

Allowed values: >= 0

Default value: 800

# Signals

fileMonitorChanged :: FileMonitorClass monitor => Signal monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ())