Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use fileID from FILE_ID_BOTH_DIR_INFO for the stat ino field on Win32 #613

isaacs opened this Issue Nov 2, 2012 · 4 comments


None yet
2 participants

@isaacs isaacs referenced this issue in nodejs/node-v0.x-archive Nov 2, 2012


fs.Stats.ino always returns 0 on Windows #2670


piscisaureus commented Nov 2, 2012

Agreed, with the following notes:

  • FILE_ID_BOTH_DIR_INFO can only be read when enumerating a directory. We can also query this information with NtQueryInformationFile using the IndexNumber field (see http://msdn.microsoft.com/en-us/library/windows/hardware/ff540318(v=vs.85).aspx)
  • A problem is that the file id is a 64-bit integer. struct stat on windows does not accommodate a 64-bit integer in the st_ino field, so we'd have to define our own struct uv_stat.
  • Javascript cannot represent 64-bit integers reliably, so for node additional creativity is needed.

isaacs commented Nov 2, 2012

So, it's a bit hacky... but... is the st_dev set to zero as well? Maybe the high 32 bits can be used for the st_dev, and the low 32 can be the inode? Of course, this will break programs that use the dev number to actually determine the device, but I wonder how many of those there are, actually. In reality, you can't rely on just st.st_ino anyway, you have to also consider the st_dev, since the same inode on two different devices is not the same file.


piscisaureus commented Nov 2, 2012

st_dev is currently zero for the same reason.

@israels israels referenced this issue in pahen/madge Jan 9, 2013


Comprehend Sugared AMD Modules #8


piscisaureus commented Dec 7, 2013

Fixed in 20a8e58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment