I am writing log file system via fuse (FUSE-JNA). What I want to do is
- log/insert current time in database table when user opens a file
- and insert current time in database table when user closes a file
it is Just like web server logs.
For this, I thought implementing open() and release() methods would work:
public int open(final String path, final FileInfoWrapper info)
{
System.out.println("open called: Path="+path); //replaced with code for inserting current time in database table
return 0;
}
@Override
public int release(final String path, final FileInfoWrapper info)
{
System.out.println("release called: Path="+path);//replaced with code for inserting current time in database table
return 0;
}
1-These methods are called when I open a file, that is fine
2-But when I just open the folder, These methods are also called for each file in the folder
How I would I distinguish between the above two. Because I just need to insert time when user open's a file and close time. Not when user open directory.
Please somebody help