I work in Linux. In Linux with stat function, we can extract the permissions of a file.

Similarly how can we extract the permissions of a file in windows. 

\_stat function in msdn states that permission bits are set in the stat buffer. But it does not give how to extract them. 

<http://msdn.microsoft.com/en-us/library/14h5k7ff%28VS.71%29.aspx>
['https://Stackoverflow.com/questions/3449465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/266836/']
The struct stat structure does *not* contain any file permission info on Windows. Windows security is far more convoluted, you'd need GetFileSecurity() to retrieve the DACL for the file. That's rarely done in a Windows program, you'd typically let Windows evaluate the effective permissions and deal with the "you can't do it" error return. ERROR\_ACCESS\_DENIED from GetLastError().
I read in the link you provided that among others, file permissions as implemented in `_stat` and friends are UNIX specific and are left unused for NTFS, FAT and other Windows filesystems.

I think you will have more luck reading file permissions using the classic [FindFirstFile](http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx) and related functions. You'll need to process the handle returned with functions described [here](http://msdn.microsoft.com/en-us/library/aa364399(v=VS.85).aspx)
These are highly unportable, but as C++ has no filesystem support, they are the only good choice.