 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tom Reiertsen Guest
|
Posted: Mon Aug 25, 2003 8:28 am Post subject: Retrieving access rights to a directory. |
|
|
I've been twisting my mind to figure out a good way to get the access rights
to a directory.
I need to find out if:
1. The directory given can be read (ie. read access)
2. The directory given can be written to (ie. write access).
I guess 1 is trivial, just try to list it's contents. I guess this will work
with populated directories but what if the directory is empty?
# 2 could be solved by trying to create an empty file and then delete it
(catching any IO errors in the progress). However, this will be a problem if
you have write access but not delete access.
Any tips/pointers will be greatly appreciated.
Best regards,
Tom Reiertsen,
Reiertsen Software Systems.
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Mon Aug 25, 2003 2:22 pm Post subject: Re: Retrieving access rights to a directory. |
|
|
"Tom Reiertsen" <tom (AT) reiertsen (DOT) com> wrote in message
3f49c898$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Any tips/pointers will be greatly appreciated.
|
The Platform SDK documentation has some sample code for this. It's written
in C, but should be translatable:
ms-help://MS.PSDK.1033/security/security/searching_for_a_sid_in_an_access_token.htm
http://www.microsoft.com/msdownload/platformsdk/sdkupdate
Cheers,
Ignacio
--
No, don't send me e-mail directly. No, just don't.
|
|
| Back to top |
|
 |
Colin Wilson Guest
|
Posted: Mon Aug 25, 2003 11:26 pm Post subject: Re: Retrieving access rights to a directory. |
|
|
Tom Reiertsen wrote:
| Quote: | # 2 could be solved by trying to create an empty file and then delete
it (catching any IO errors in the progress). However, this will be a
problem if you have write access but not delete access
|
There are free classes available on my website that will do this. Go
for the 'NT Low Level Utilities' package. They work on NT4, W2K & XP...
--
Colin
e-mail :colin (AT) wilsonc (DOT) demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm
Posted with XanaNews 1.15.6.2
|
|
| Back to top |
|
 |
Tom Reiertsen Guest
|
Posted: Tue Aug 26, 2003 8:13 am Post subject: Re: Retrieving access rights to a directory. |
|
|
"Colin Wilson" <colin (AT) wilsonc (DOT) demon.co.uk> skrev i melding
news:3f4a9b3d (AT) newsgroups (DOT) borland.com...
| Quote: |
There are free classes available on my website that will do this. Go
for the 'NT Low Level Utilities' package. They work on NT4, W2K & XP...
|
Excellent!
Thanks Colin!
Tom.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|