Lars Gullik Bjønnes wrote:
This version of is_readonly is racy. So for win32 we should try to avoid this. An non-racy version would look like this? (right?)

bool is_readonly(patch const & ph)
{
        DWORD const attr = ::GetFileAttributes(ph.string().c_str());
        return (attr != INVALID_FILE_ATTRIBUTES
                && (attr & FILE_ATTRIBUTE_READONLY));
}

Yeah, that should work.

Regards,
Asger



Reply via email to