A question about execv in FUSE

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A question about execv in FUSE

Peng Li
Hi all,

I am a newbie in FUSE and I meet some trouble when I try to use execv in FUSE daemon. I am using FUSE3.0 on ubuntu16.04.  What I am trying to do is backing up the file when I open it. So, in the open function in FUSE, I execute fork and use execv to execute command “cp". I also try to catch error with log and there is nothing wrong in the log(seems like execv is successfully executed). However, there is nothing happen to my file when I open it. 

So my question is: How to execute a command like cp and mkdir during the file operation in FUSE?
I hope someone can help me. Thank you in advance. 

Sincerely,
Peng Li
M.S. in Computer and Information Technology
Purdue University 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: A question about execv in FUSE

Yue Li
hi Peng,


On 3/23/17 3:14 PM, Peng Li wrote:
> Hi all,
>
> I am a newbie in FUSE and I meet some trouble when I try to use execv in FUSE daemon. I am using FUSE3.0 on ubuntu16.04.  What I am trying to do is backing up the file when I open it. So, in the open function in FUSE, I execute fork and use execv to execute command “cp". I also try to catch error with log and there is nothing wrong in the log(seems like execv is successfully executed). However, there is nothing happen to my file when I open it.
Doing "cp" in side open() will trigger another call to open() which
unfortunately recursively does cp. I'm actually surprised that you did
not see any stack overflow...

Best,

Yue



> So my question is: How to execute a command like cp and mkdir during the file operation in FUSE?
> I hope someone can help me. Thank you in advance.
>
> Sincerely,
> Peng Li
> M.S. in Computer and Information Technology
> Purdue University
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel