tags:

views:

120

answers:

2

Also, is there a cross-platform way to change the attribute of a file from read-only to writeable?

Thanks much, Bert

+7  A: 

Check out boost::filesystem. It'll do what you need. I believe this is one of the parts of boost that is going to be included in the next version of C++, at which time it will become part of the STL, but right now it's a (free) 3rd-party library. It's so common that it can almost be considered standard though.

rmeador
Why do you believe it will be part of the next C++ standard? I can't find any reference to it in the draft I have.
anon
Yeah it is not mentioned in the wikipedia article either. I suspect this is wishful thinking
1800 INFORMATION
from the link in my answer: "A proposal, N1975, to include Boost.Filesystem in Technical Report 2 has been accepted by the C++ Standards Committee."
rmeador
Unfortunately, TR2 is not part of C++0x but will come later. http://en.wikipedia.org/wiki/C%2B%2B0x
zdan
+2  A: 

The only way to do this is to use operating system specific features - C++ has no functionality in this area.

anon