Skip to main content
GameDev.net gamedev.net
🔒 Locked

Viewing/Changing File Attributes

Started by Spyder_Snyper Jun 14, 2006 at 8:07 AM 2 replies 800+ views
Original Post
Spyder_Snyper
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...
Enigma
Enigma
GetFileAttributes. You may also want to look at GetFileAttributesEx, SetFileAttributes and SetFileInformationByHandle.

Σnigma
rip-off
rip-off
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";}
Spyder_Snyper
Spyder_Snyper
Hey, PRIMO info... thanks a TON...

That link is EXACTLY what I was looking for...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.