Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuseRunInline blocks #9

Open
hankfire opened this issue Oct 24, 2018 · 1 comment
Open

fuseRunInline blocks #9

hankfire opened this issue Oct 24, 2018 · 1 comment

Comments

@hankfire
Copy link

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.

@rickynils
Copy link

@hankfire Did you ever get this to work? I have a use case that is identical to the one you describe (mount fs and run external command), but I have no luck either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants