Can't Get File Serial Number (st_ino) from files on sdCard/Flash

plusorc
Posts: 41
Joined: Sat Nov 09, 2019 6:27 am

Can't Get File Serial Number (st_ino) from files on sdCard/Flash

Postby plusorc » Sun Sep 24, 2023 5:12 pm

Every thing that is working on C / linux system , Is working on ESP Flash

Code: Select all

struct stat st ; 
char* filePath = "/sdcard/myFile.txt"; 
stat(filePath, &st);
	
From here I can get all the usual info , Size , Name , Type of File .. except the st.st_ino
It's always zero

I even get a warning about the proper type to print at compilation and I have to cast it to unsigned long
But it's always Zero .. what am I missing ?


Thanks in advance

MicroController
Posts: 1724
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Can't Get File Serial Number (st_ino) from files on sdCard/Flash

Postby MicroController » Sun Sep 24, 2023 10:49 pm

FAT does not have/use/store inodes. Linux can 'emulate' inode numbers when stat'ing FAT files by generating 'random' numbers on the fly, but ESPs usually don't run Linux.

plusorc
Posts: 41
Joined: Sat Nov 09, 2019 6:27 am

Re: Can't Get File Serial Number (st_ino) from files on sdCard/Flash

Postby plusorc » Mon Sep 25, 2023 1:19 am

Thanks for the info on both ESPs & Linux :)

I really Appreciate your help

Who is online

Users browsing this forum: Google [Bot] and 200 guests