Skip to content

fuseRunInline blocks #9

@hankfire

Description

@hankfire

Hi I am trying to use HFuse for a hit-and-run-scenario: my application should mount the virtual FS, execute an external shell command (using callCommand) that uses that FS, unmount the FS.

It seems the fuseRunInline was made for that, where I pass the callCommand bit into the 3rd parameter (act). 1st and 2nd parameter (register and unregister) are "optional" in that I can just pass pure (), right? So like this

main :: IO ()
main = do
  fuseRunInline
     (\fd op -> pure ())
     (\x -> pure())
     (\s -> threadDelay 20000000)
    "hellofs" ["/home/user/tmp"]
    helloFSOps
    defaultExceptionHandler

except instead of the callCommand bit I put in a 20 sec delay as a placeholder, the actual command will come later.

If I run this (with ghc-options -threaded and -with-rtsopts=-N10 then it mounts, waits 20 second and unmounts just fine. I can verify the mound using the mount unix command during those 20 seconds. But during those 20 seconds I cannot e.g. list the contents of the virtual FS, i.e. `ls -l /home/user/tmp'. That blocks until the 20 seconds are over and then fails with an error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions