I'm developing a FUSE app that takes a directory with mp3's and mounts a filesystem in another directory with the following structure (according to their tag's):
Artist1
|
-----> Album11
|
-----> Track01
-----> Track02
-----> Track03
-----> Track04
-----> Track05
-----> Album12
....
Artist2
|
-----> Album21
-----> Album22
....
Artist3
.....
I'm using a sqlite3 database to mantain the links to the real files. The artists and albums elements are folders, and the tracks elements are links to the real ones.
I have achieved to create the folders for the artists and the albums. But now I have a problem.
I have this:
static int getattr(...) {
....
else if ( level == 0 || level == 1 || level == 2 )
{
// Estamos en el primer nivel. Son artistas, y por lo tanto, carpetas.
stbuf->st_mode = S_IFDIR | 0755;
stbuf->st_nlink = 2;
lstat(path, stbuf);
}
else if (level == 3) {
// Estamos en el tercer nivel. Son canciones, por lo que son enlaces
stbuf->st_mode = S_IFLNK | 0755;
stbuf->st_nlink = 2;
lstat(path, stbuf);
}
.....
}
And now, When I ls in the tracks directory y get a message that tells me that the function is not implemented (the links functions). Which function do I have to implement to know where the link points? Or where do I have to fill the direction of the pointer?
Thanks!