Class | RFuse::Fuse |
In: |
lib/rfuse.rb
|
Parent: | Object |
Convenience method to run a mounted filesystem to completion.
@param [Array<String|Integer>] signals list of signals to handle.
Default is all available signals. See {#trap_signals}
@return [void] @since 1.1.0 @see RFuse.main
Set traps
The filesystem supports a signal by providing a `sig<name>` method. eg {sigint}
The fuse {loop} is notified of the signal via the self-pipe trick, and calls the corresponding
`sig<name>` method, after any current filesystem operation completes.
This method will not override traps that have previously been set to something other than "DEFAULT"
Note: {Fuse} itself provides {sigterm} and {sigint}.
@param [Array<String>] signames
List of signal names to set traps for, if the filesystem has methods to handle them. Use `Signal.list.keys` to try all available signals.
@return [Array<String>] List of signal names that traps have been set for.
@since 1.1.0
@example
class MyFS < Fuse def sighup() # do something on HUP signal end end fuse = MyFS.new(*args) if fuse.mounted? # Below will result in (effectively) Signal.trap("HUP") { fuse.sighup() } fuse.trap_signals("HUP","USR1") # ==> ["HUP"] fuse.loop() end