Reputation: 149
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
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