[SATLUG] Programming file permissions

Bruce Dubbs bruce.dubbs at gmail.com
Wed Apr 2 16:34:55 CDT 2008

I am trying to write a program for both Linux and Windows.  I would like 
to create a file that restricts read/write permissions to the owner.  In 
linux/unix, this is trivial:

chmod( "/home/user/myfile.txt", 0600 );

Does anyone know how to do the equivalent thing in Windows.  I was able 
to do what I wanted by right-click->properties->security->advanced

unselect "Inherit from parent permission entities..."

And then select unwanted groups like Everyone and "Remove".

I want to do that within a C++ program.  Does anyone have any idea how 
to do this?

BTW, did I say before that Windows is a PITA?

   -- Bruce

More information about the SATLUG mailing list