-
Notifications
You must be signed in to change notification settings - Fork 1
system.file watcher
load system.file-watcher
This module provides the System.FileWatcher class which provides an awaitable file implementation.
This enum describes the different modifications that can be watched on a file.
| Constant | Value | Description ||----------|-------|-------------|
| Attributes | 0x04 | The attributes of the file has changed |
| Data | 0x02 | The content of the file has changed |
| Name | 0x01 | The file name has changed |
This class provides an awaitable file implementation that trigger an event when the file is modified.
This class only provides basic file mechanism as write and read raw data. To perform extended operations on files, use System.File.
This type is not copyable
| Modifiers | Member | Description |
|---|---|---|
enum |
Change | This enum describes the different modifications that can be watched on a file. |
const |
getHandle | Returns the event's handle as an instance of mint::handle_t. |
const |
getPollEvent | Returns the event's poll event as an instance of mint::poll_event_t. |
const |
new | Creates a new file. The file is automatically opened. The path parameter must... |
const |
reset | Reset the internal event state |
const |
toFile | Returns a System.FileWatcher.System.File instance associated with this file w... |
const |
wait | Waits until the file is modified. If timeout is given, the wait stop after ti... |
| Modifiers | Member | Description |
|---|---|---|
const |
clone | Disable object copy. |
final |
d_ptr | Object data. |
@ const
|
g_lib | Global library handle. |
final |
path | Internal file path |
0x04
The attributes of the file has changed
0x02
The content of the file has changed
0x01
The file name has changed
none
Disable object copy.
null
Object data.
lib ('libmint-system')
Global library handle.
def (const self)
Returns the event's handle as an instance of mint::handle_t.
def (const self)
Returns the event's poll event as an instance of mint::poll_event_t.
def (self, path, flags = System.FileWatcher.Change.Data)
Creates a new file. The file is automatically opened.
The path parameter must be a string containing the path to the file
to open.
The flags parameter must be a combination of values from the
System.FileWatcher.Change enum and describes the watched events types.
If no file can be opened at the given path with the given mode,
none is returned.
null
Internal file path
def (self)
Reset the internal event state
def (self)
Returns a System.File instance associated with this file watcher. The returned file is opened with the same mode as the file watcher.
def (self, timeout = none)
Waits until the file is modified. If timeout is given, the wait
stop after timeout milliseconds if the file is still not modified.
Returns true if the file is modified; otherwise returns false if
the wait timed out.
After a call to this method, the event is reset.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules