Data Chanturia
Data Chanturia

Reputation: 149

Writing FS with FUSE, function not implemented error when `cat>a`

I'm writing FS with FUSE, here are the functions I've implemented:

create open read write release unlink mkdir opendir readdir releasedir rmdir getattr rename

Everything works fine, except this case: when I first try cat>a (when a file still does not exist) it works fine: creates "a" and lets me write something in it.

But when I type again cat>a It tells me -bash: a: Function not implemented. (Similar message appears when I try to modify file with nano a it opens let's me write in, but after trying to save modifications the same message appears in nano)

What can be the cause? Which function may I me missing? Or which function may be implemented not properly?

Upvotes: 0

Views: 3210

Answers (1)

Charles Duffy
Charles Duffy

Reputation: 295272

Unless the mount was done with the atomic_o_trunc option, you need to implement truncate() for open() with O_TRUNC (as is used when opening a file with > rather than >>) to succeed.

Upvotes: 1

Related Questions