How to use file links ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use file links ?

Samuel Goto
hi,

    How can i use symbolic and hard links in fuse ?

    I can see that there are special call backs for creating symbolic
and hardlinks, but once I create a link, how can I internally
represent it and tell getattr( file )  that this file is a symbolic
link instead of a regular/directory file ?

    struct stat doesn't seem to help me telling that this file is a link ...

    Any help ?

--
f u cn rd ths u cn b a gd prgmr !


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use file links ?

Joshua J. Berry
On Saturday 24 September 2005 22:03, Samuel Goto wrote:
>     I can see that there are special call backs for creating symbolic
> and hardlinks, but once I create a link, how can I internally
> represent it and tell getattr( file )  that this file is a symbolic
> link instead of a regular/directory file ?

Look at struct stat's st_mode field.

--
Joshua J. Berry

"I haven't lost my mind -- it's backed up on tape somewhere."
    -- /usr/games/fortune

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use file links ?

Joshua J. Berry
On Saturday 24 September 2005 23:43, Joshua J. Berry wrote:
> On Saturday 24 September 2005 22:03, Samuel Goto wrote:
> >     I can see that there are special call backs for creating symbolic
> > and hardlinks, but once I create a link, how can I internally
> > represent it and tell getattr( file )  that this file is a symbolic
> > link instead of a regular/directory file ?
>
> Look at struct stat's st_mode field.

Whups.  That's for symlinks, and you also asked about hard links.

Hard links don't look any different from regular files -- the only thing
that gives them away as hard links is the fact that they have the same
inode numbers (struct stat->st_ino).

--
Joshua J. Berry

"I haven't lost my mind -- it's backed up on tape somewhere."
    -- /usr/games/fortune

attachment0 (196 bytes) Download Attachment