Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
How can I access file by inode on Linux

is there any userspace API or third-party kernel module that can help to access file by inode on Linux?

I'm trying to implement something like:

int read_file_by_ino(int ino, int pos, int size, char* buf);
int write_file_by_ino(int ino, int pos, int size, const char* buf);
int readdir_by_ino(...);
int stat_by_ino(...);
...

The program is expected to run under root user, so there's no security requirement to do permission checking.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I found the question connected concerning similar topic here.

Summarizing, check out those commands:

  • find /path/to/mountpoint -inum <inode number>
  • sudo debugfs -R 'ncheck 393094' /dev/sdaX 2>/dev/null

Hope this helps you investigate further.

over 4 years ago · Santiago Trujillo Relatório

0

Not sure if I understood your problem correctly but:
You can start with "/" directory and proceed recursively (or any loop for that matter) with children. Compare the inode value with strcut stat.ino_t. Once you find it, open the path/file.

over 4 years ago · Santiago Trujillo Relatório

0

I don't know if there is an easier way or not but you can do this with bash. with ls -i command you can see the inodes too,

$ ls -i
11147622 file.txt

the first column is the inode number, the blow command shows the inodes in current directory

$ ls -i | awk {'print $1'}

so you need to check the inodes from / too all it's subdirectories until find it

ls -iR /

it shows all subdirectories and there files with there inode number

now you should start from / and use awk to or cut command to have the first column(inode number is in the first column) then compare it with the inode you want to find.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda