Jump to content
  • Advertisement
Sign in to follow this  
ukdeveloper

Viewing/changing file attributes

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was wondering if it was possible to use fstream to alter the attributes of a file? I'm using C++. For example, I could use fstream to make a file read-only or archived, like you can when you right-click in Windows or use the attrib command? I'd also like to be able to get a file's properties e.g. size, last accessed, etc. and display them in a console window, is this possible using the standard library or do I need something like Boost? Thanks in advance, ukdeveloper.

Share this post


Link to post
Share on other sites
Advertisement
fstream is non file attribute aware. boost is also only aware of certain file attributes like last write time. For full access to the file attributes you'll need to use OS specific functions.

Share this post


Link to post
Share on other sites
Uh...what? It's designed to read and write from files, not change their attributes. It's very useful for that :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!