[SATLUG] Programming file permissions

Ernest De Leon edeleonjr at gmail.com
Wed Apr 2 17:49:44 CDT 2008

unfortunately the dir /q is the only way I can think of to grab the owner
quickly.  You will just have to drop the output into an array of some sort
and grab the 4th column, then parse the string to drop the domain and '\'
char....this is very easy and fast in python...but in C++...it's not going
to be pretty


On Wed, Apr 2, 2008 at 3:32 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:

> Ernest De Leon wrote:
> > you will need to have the C++ proggy call the shell (CMD) and run a
> > cacls
> > command (just google cacls)  you should be able to do what you want
> > through
> > there.  My only advice is to be mindful of how win acls lay down vs
> > posix
> > ones.  One of the biggest headaches storage vendors run into when trying
> > to
> > emulate windows server shares that run on top of linux file systems is
> > the
> > posix to winacl mappings.
> >
> Thanks Ernest.  That's a start.  It looks like I can do
>  echo Y|cacls /E /R user  filename
> Now if I can figure out who is the owner (so I don't remove permissions)
> and what the other "users" are, I'm all set.  I suppose I can get the owner
> via DIR /Q filename.
> I'd really like to not have to parse the verbose output that cacls and dir
> create.
>  -- Bruce
>   BTW, did I say before that Windows is a PITA?
> > > >
> > > --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to unsubscribe
> Powered by Rackspace (www.rackspace.com)

Ernest de Leon

"They who can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - A common 18th Century sentiment
voiced by Benjamin Franklin

"A patriot must always be ready to defend his country against his
government." - Edward Abbey

"All that is necessary for evil to triumph is for good men to do nothing." -
Edmund Burke, English statesman and political philosopher (1729-1797)

More information about the SATLUG mailing list