:: Re: [DNG] What to do with an inode?
Pàgina inicial
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
A: dng
Assumpte: Re: [DNG] What to do with an inode?
Le 30/03/2020 à 16:33, Hendrik Boom a écrit :
> On Mon, Mar 30, 2020 at 03:18:45PM +0000, aitor_czr wrote:
>> $ ls --inode --directory "/"
>>
>> 2 /
> Is there anything I can do with an inode except check file identity within
> a filesystem?
>
> Can I, for example open a file for reading or writing
> or read a directory given the inode number
> instead of the full pathname?
>
> I mean, as a programmer in user or superuser mode,
> not running my own code inside the kernel.
>
> -- hendrik
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


    AFAIK the only thing you can do with an inode is to check that two
files are actually hardlinks to the same file. You cannot open it and
you cannot obtain any information on it, including the filename. There
seems to be no function in the libc, and probably no system call which
takes the inode as an input parameter.

    Didier