how to implement the setattr for file write ?

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

how to implement the setattr for file write ?

Samuel Goto
Hi,

   I am building a new fuse fs, and i am having a small problem.

   compiling and installing fuse is ok. running examples too.

   I want to have writable files on my file system, and it seems that
none of the examples fs in the distro comes with this feature ( well,
perhaps it does and i am not using it ... ). Running the hello ( or
fusexmp ) for example

  ./hello -d /tmp/fuse/

  and then

  echo "hi" > /tmp/fuse
  bash: /tmp/fuse/hello : Function not implemented

  and then i notice that what is acctually missing is an
implementation of the SETATTR at some point ...

  Am i missing something, or there are no easy (easy meaning not in
the examples, not changing fuse lib source, etc ) way to implement
file writing in fuse ? Google doesn't seem to know it ...  neither
list history ... Since many fs uses file writing, i am guessing that
this is very possible ... well, then how ?

  thanks in advance, samuelgoto

 
 
   
--
f u cn rd ths u cn b a gd prgmr !


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to implement the setattr for file write ?

Leandro Franco
hi,

try example/fusexmp.c
i suppose xmp_write is the function you are looking for....


Leandro


On 9/15/05, Samuel Goto <[hidden email]> wrote:

> Hi,
>
>    I am building a new fuse fs, and i am having a small problem.
>
>    compiling and installing fuse is ok. running examples too.
>
>    I want to have writable files on my file system, and it seems that
> none of the examples fs in the distro comes with this feature ( well,
> perhaps it does and i am not using it ... ). Running the hello ( or
> fusexmp ) for example
>
>   ./hello -d /tmp/fuse/
>
>   and then
>
>   echo "hi" > /tmp/fuse
>   bash: /tmp/fuse/hello : Function not implemented
>
>   and then i notice that what is acctually missing is an
> implementation of the SETATTR at some point ...
>
>   Am i missing something, or there are no easy (easy meaning not in
> the examples, not changing fuse lib source, etc ) way to implement
> file writing in fuse ? Google doesn't seem to know it ...  neither
> list history ... Since many fs uses file writing, i am guessing that
> this is very possible ... well, then how ?
>
>   thanks in advance, samuelgoto
>
>
>
>
> --
> f u cn rd ths u cn b a gd prgmr !
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> fuse-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to implement the setattr for file write ?

Miklos Szeredi
In reply to this post by Samuel Goto
>    I am building a new fuse fs, and i am having a small problem.
>
>    compiling and installing fuse is ok. running examples too.
>
>    I want to have writable files on my file system, and it seems that
> none of the examples fs in the distro comes with this feature ( well,
> perhaps it does and i am not using it ... ). Running the hello ( or
> fusexmp ) for example
>
>   ./hello -d /tmp/fuse/
>
>   and then
>
>   echo "hi" > /tmp/fuse
>   bash: /tmp/fuse/hello : Function not implemented
>
>   and then i notice that what is acctually missing is an
> implementation of the SETATTR at some point ...

SETATTR is actually 4 different methods rolled into one: chmod, chown,
truncate and utime.  You need to implement at least truncate() for
open(... O_TRUNC) to work.

Miklos


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel