Jump to content
  • Advertisement
Sign in to follow this  
Spyder_Snyper

Viewing/Changing File Attributes

This topic is 4561 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

So I want to be able to view and change the permissions for a specific file. And for some reason, I can't seem to find any info on this topic...
cout << GetFileAttributes("testText.txt") << endl;
This code prints out "32". I have NO idea what that means. Given enough time, I probably COULD figure it out on my own, but I'm feeling all that up to it at the moment. The other thing I'd like to know is about SetFileAttributes (if there IS one...). Basically, eveything about getting and setting file attributes. I'm going for the Windows solutino if possible. Windows XP preferably... Thanks...

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Spyder_Snyper
So I want to be able to view and change the permissions for a specific file. And for some reason, I can't seem to find any info on this topic...


cout << GetFileAttributes("testText.txt") << endl;


This code prints out "32". I have NO idea what that means. Given enough time, I probably COULD figure it out on my own, but I'm feeling all that up to it at the moment.

The other thing I'd like to know is about SetFileAttributes (if there IS one...). Basically, eveything about getting and setting file attributes.

I'm going for the Windows solutino if possible. Windows XP preferably...

Thanks...


Here is a link that descibes the function. It has a link to SetFileAtrributes at the bottom. The return value is probably a bitmask.

For example:

DWORD value = GetFileAttributes( "isItADirectory" );
if( value & FILE_ATTRIBUTE_DIRECTORY )
{
std::cout << "File is a directory...\n";
}




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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!