> I am writing a filesystem on top of FUSE mainly
> by rewriting the FUSE example program.
> Can anyone tell me which method will be called
> for the close system call?.
Read fuse.h... ;-)
/** Possibly flush cached data
* BIG NOTE: This is not equivalent to fsync(). It's not a
* request to sync dirty data.
* Flush is called on each close() of a file descriptor. So if a
* filesystem wants to return write errors in close() and the file
* has cached dirty data, this is a good place to write back data
* and return any errors. Since many applications ignore close()
* errors this is not always useful.
* NOTE: The flush() method may be called more than once for each
* open(). This happens if more than one file descriptor refers
* to an opened file due to dup(), dup2() or fork() calls. It is
* not possible to determine if a flush is final, so each flush
* should be treated equally. Multiple write-flush sequences are
* relatively rare, so this shouldn't be a problem.
int (*flush) (const char *, struct fuse_file_info *);
/** Release an open file
* Release is called when there are no more references to an open
* file: all file descriptors are closed and all memory mappings
* are unmapped.
* For every open() call there will be exactly one release() call
* with the same flags and file descriptor. It is possible to
* have a file opened more than once, in which case only the last
* release will mean, that no more reads/writes will happen on the
* file. The return value of release is ignored.
int (*release) (const char *, struct fuse_file_info *);