[python-win32] get file owner and FindFirstChangeNotification

Jos Yule jos@trapeze.com
Mon, 7 Jan 2002 17:38:00 -0500


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all!

First question:

I was reading the archives and found a thread [1] dealing with using
the win32security module to find a files owner. However it seemed
that the process as described in the thread and at msdn does not work
as advertised. I tried out the example code [2] and got similar
results (same pyHandle for all the files). 

I was also intrigued by Emile van Sebille's example of using
os.popen("dir /q hack.py") [3]... I've been unable to get this to
work as described...

Basically, i'm wondering if anybody has been able to determine who
'owns' a file on NT/2K. The info i'm looking for is also who last
wrote/edited a file. I've been assuming that they are one in the
same, but i could be wrong. Any help would be greatly appreciated!

Second question:

I'm using the FindFirstChangeNotification and WaitForMultipleObjects
win32event methods. I'd like to know what is a 'reasonable' number of
items to put into the FindFirstChangeNoticication list. Is every item
you put into the list a thread? or rather is a thread spawned for
each item in that list? Can i have 50 items? 100? 1000? 

I'd also like to know if it is possible (i'm pretty sure its not) to
figure out what triggered the WaitForMultipleObjects... ie. I've set
it to wait for the following:

win32con.FILE_NOTIFY_CHANGE_LAST_WRITE
win32con.FILE_NOTIFY_CHANGE_DIR_NAME
win32con.FILE_NOTIFY_CHANGE_FILE_NAME

Is it possible to get from the result of the WaitForMultipleObjects
which one of these 'triggers' (? not even really sure what to call
them) fired? 

Does this make any sense? If you've hung in this long, i might as
well explain what i'm working on. Basically, i want a python
script/app to watch a directory, and anytime any file or any change
is made to any directory or file in that main directory, mirror it in
a repository directory, appending some kind of version number to the
file. This would allow for basic version control. 

Again, thanks for your time, hope folks that celebrate (north
american) new years/christmas had a good one! (and i hope the rest of
you that didn't had a good time too)

jos


[1] http://aspn.activestate.com/ASPN/Mail/Message/898077
[2] http://aspn.activestate.com/ASPN/Mail/Message/901227
[3] http://aspn.activestate.com/ASPN/Mail/Message/898155



Jos Yule
Trapeze
mailto:jos@trapeze.com
http://trapeze.com
phone:416 601 1999 x227 

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBPDojSN4WdA43RP/AEQKL1QCfczIFsF54RIsEcVQ2/ZHMBX57VK0AoJ4D
Me9VYsEBH3u0zGEyGGlbh9aV
=rekl
-----END PGP SIGNATURE-----