[python-win32] Re: Using win32file.CreateDirectory including setting

2005-01-28 Thread Roger Upole
Note the flags in the ACE when you set the permissions manually. The difference is not in the access mask, but in the flags. AddAccessAllowedAce doesn't provide for inheritance flags. You need to use AddAccessAllowedAceEx in order to be able to duplicate these permissions exactly. acl2.AddAccessAll

[python-win32] Re: Folder permissions

2005-01-28 Thread Roger Upole
There will only be a single group on the security descriptor itself. Depending on who created the files and how they were created, it wouldn't be unusual to have a variety of groups present on different files. To get a list of everyone who has access, you need to look at the DACL. It includes gro

Re: [python-win32] Folder permissions

2005-01-28 Thread Alex Willmer
Ryan Parrish wrote: Hi, this is my first jump into the win32 world of python so please excuse me and carry on your normal life's if what I'm saying makes no sense at all :-) I am trying to write a script that will walk all my directories and get the users/groups and there respective permissions t

RE: [python-win32] Re: Folder permissions

2005-01-28 Thread Ryan Parrish
Here is what I have as a little test... import os, win32security, ntsecuritycon for root, dirs, files in os.walk("c:\\"): sd= win32security.GetFileSecurity(root, win32security.GROUP_SECURITY_INFORMATION) sid= sd.GetSecurityDescriptorGroup() print root," ", win32security.LookupAccount

[python-win32] Re: Folder permissions

2005-01-28 Thread Roger Upole
GetFileSecurity should be able to pick up the correct info, assuming you have sufficient permission to read the security descriptor. Does it pick up any permissions at all ? GetNamedSecurityInfo which the fileperm c code uses is also in the win32security module. What leads you to conclude that the

[python-win32] Re: Determine file being accessed

2005-01-28 Thread Roger Upole
You get permission denied if you try to move a file while it's being written to, so you could just keep on trying to move it until you succeed. I actually had to do this once, and it worked very reliably. Roger "Neil Benn" <[EMAIL PROTECTED]> wrote: Hello, I have a job where I need

[python-win32] Folder permissions

2005-01-28 Thread Ryan Parrish
Hi, this is my first jump into the win32 world of python so please excuse me and carry on your normal life's if what I'm saying makes no sense at all :-) I am trying to write a script that will walk all my directories and get the users/groups and there respective permissions that are assigned to

RE: [python-win32] 'import win32com' fails from within an embeddedinterpreter

2005-01-28 Thread Mark Hammond
> I'm hoping someone can give me some advice, or point me in a > helpful direction. > > I've embedded python 2.4 within an application that needs to > connect with > MS Excel. > I've written the python code to communicate with Excel and > tested it from > the python > command line interpreter. It

[python-win32] 'import win32com' fails from within an embedded interpreter

2005-01-28 Thread quadric
I'm hoping someone can give me some advice, or point me in a helpful direction. I've embedded python 2.4 within an application that needs to connect with MS Excel. I've written the python code to communicate with Excel and tested it from the python command line interpreter. It works great! How

RE: [python-win32] Determine file being accessed

2005-01-28 Thread Tim Golden
[Neil Benn] | I have a job where I need to move a file on a trigger from | another program, however this program may or may not have finished | writing to the file when I need to move it (I have no way of changing | this behavior). Therefore I need to determine if a file is | still

[python-win32] Embedding and Extending Python within one C++ dll, on Windows.

2005-01-28 Thread Richard Kerry
I wonder if someone can provide me with some advice, or guide me to resources where I can find this information. I am trying to embed Python in a C++ class, and also extend it with code in that class, or more accurately with code in a base class of that class. This is in Windows, so it's all in

[python-win32] Determine file being accessed

2005-01-28 Thread Neil Benn
Hello, I have a job where I need to move a file on a trigger from another program, however this program may or may not have finished writing to the file when I need to move it (I have no way of changing this behavior). Therefore I need to determine if a file is still being written to,