From: Daniel Berger Date: 2004-11-27T13:06:46+09:00 Subject: File::Stat#blksize for Win32 Hi all, Can we add support for File::Stat#blksize for Win32? Below is a simple script that demonstrates how to get it. Note that, although GetDiskFreeSpace() isn't reliable for getting disk sizes over 2 GB, it is still reliable for getting block size. The only modification you might need is to attempt to get the root path of the file name, rather than resorting to NULL. Regards, Dan #include #include int main(){ DWORD dwSectorsPerCluster, dwBytesPerSector; DWORD dwNumberOfFreeClusters, dwTotalNumberOfClusters; int rv, blksize; rv = GetDiskFreeSpace( NULL, // or determine root path dynamically &dwSectorsPerCluster, &dwBytesPerSector, &dwNumberOfFreeClusters, &dwTotalNumberOfClusters ); if(0 == rv){ // Raise an error? Return nil? } blksize = dwBytesPerSector * dwSectorsPerCluster; printf("blksize: %i\n",blksize); return 0; } __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com