def loop()
            raise RFuse::Error, "Already running!" if @running
            raise RFuse::Error, "FUSE not mounted" unless mounted?
            @running = true
            while @running do
                begin
                    ready, ignore, errors  = IO.select([@fuse_io,@pr],[],[@fuse_io])

                    if ready.include?(@pr)

                        signo = @pr.read_nonblock(1).unpack("c")[0]

                        # Signal.signame exist in Ruby 2, but returns horrible errors for non-signals in 2.1.0
                        if (signame = Signal.list.invert[signo])
                            call_sigmethod(sigmethod(signame))
                        end

                    elsif errors.include?(@fuse_io)

                        @running = false
                        raise RFuse::Error, "FUSE error"

                    elsif ready.include?(@fuse_io)
                        if process() < 0
                            # Fuse has been unmounted externally
                            # TODO: mounted? should now return false
                            # fuse_exited? is not true...
                            @running = false
                        end
                    end
                rescue Errno::EWOULDBLOCK, Errno::EAGAIN
                    #oh well...
                end
            end
        end
def loop()
            raise RFuse::Error, "Already running!" if @running
            raise RFuse::Error, "FUSE not mounted" unless mounted?
            @running = true
            while @running do
                begin
                    ready, ignore, errors  = IO.select([@fuse_io,@pr],[],[@fuse_io])

                    if ready.include?(@pr)

                        signo = @pr.read_nonblock(1).unpack("c")[0]

                        # Signal.signame exist in Ruby 2, but returns horrible errors for non-signals in 2.1.0
                        if (signame = Signal.list.invert[signo])
                            call_sigmethod(sigmethod(signame))
                        end

                    elsif errors.include?(@fuse_io)

                        @running = false
                        raise RFuse::Error, "FUSE error"

                    elsif ready.include?(@fuse_io)
                        if process() < 0
                            # Fuse has been unmounted externally
                            # TODO: mounted? should now return false
                            # fuse_exited? is not true...
                            @running = false
                        end
                    end
                rescue Errno::EWOULDBLOCK, Errno::EAGAIN
                    #oh well...
                end
            end
        end
Main processing loop

 Use {#exit} to stop processing (or externally call fusermount -u)

 Other ruby threads can continue while loop is running, however
 no thread can operate on the filesystem itself (ie with File or Dir methods)

 @return [void]
 @raise [RFuse::Error] if already running or not mounted