views:

155

answers:

1

Is there a way to change the attribute of a file from read-only to read-write using the boost filesystem library? If not, what is the next-best way to do this on Windows (using Microsoft's C++)?

+3  A: 

I didn't find how to do that in the boost library. But you can do it using Windows API:

SetFileAttributes(lpFileName, GetFileAttributes(lpFileName) & ~FILE_ATTRIBUTE_READONLY);

See SetFileAttributes Function and GetFileAttributes Function for more info.

Sergius
That's what I ended up doing. Thanks.
Brian Stewart