Hi Friends,
Can anyone tell how to change the attributes of a directory through C or C++.
I have tried to found in my compiler's help file but it was showing the method to change the file attributes but not the directory's.
I want to change the attributes of a directory from Read/Write to Read only and vice versa in my program.
Please help.......
Thanks in Advance.
Regards
Rituraj Raina
I think there are couple of ways to do this. Simplest I think is use the system call and use OS specific command within. e.g system("attrib +r mydir") will make mydir read-only.
cheers,
aj.wh.ca
aj.wh.ca
Junior Poster in Training
53 posts since Mar 2005
Reputation Points: 12
Solved Threads: 1
Hi Rituraj ,
Unless you have some other requirement for the program you are trying to develop I would call it re-inventing the wheel. For the purpose you have written, I would strongly suggest that you use Win2K control panel. You can easily assign rights on a folder (which has users data) on a per user basis. Its a very simple task that way.
regards,
aj.wh.ca
aj.wh.ca
Junior Poster in Training
53 posts since Mar 2005
Reputation Points: 12
Solved Threads: 1