Page 1 of 1

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

Posted: Sun Sep 24, 2023 5:12 pm
by plusorc
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

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

Posted: Sun Sep 24, 2023 10:49 pm
by MicroController
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.

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

Posted: Mon Sep 25, 2023 1:19 am
by plusorc
Thanks for the info on both ESPs & Linux :)

I really Appreciate your help