Sign in to follow this  

Viewing/Changing File Attributes

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

This topic is 4200 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this