Anyone knows what is the placeholder for ino_t type? I'm trying to print it out using printf and have tried %d, %i, %s and others but not working.
printf( " file name = %s, i-node number=**%d**\n", direntp->d_name, direntp->d_ino);
warning: format ‘%i’ expects argument of type ‘int’, but argument 3 has type ‘__ino_t’ [-Wformat]
Do assume my other codes are correct. Most examples only show how to print the name, but not the inode number. I have also searched many places.
Thanks in advance
If you know the type is integral, you can cast it to unsigned long long
, and use %llu
.
printf( " file name = %s, i-node number=%llu\n",
direntp->d_name, (unsigned long long)direntp->d_ino);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With