How to find if path is readonly

  • Thread starter Thread starter Alamelu
  • Start date Start date
A

Alamelu

In Windows XP how to find if a particular path is readonly

For Local path c:\Test
For Network Path \\10.33.33.33\Test
For Mapped Path (subst z: \\10.33.33.33\Test) z:\

I am able to find if a existing file is readonly using GetFileAttribute, but
to how to find if a path is readonly
 
In Windows XP how to find if a particular path is readonly
For Local path c:\Test
For Network Path \\10.33.33.33\Test
For Mapped Path (subst z: \\10.33.33.33\Test) z:\

I am able to find if a existing file is readonly using GetFileAttribute, but
to how to find if a path is readonly

Directories also have a read-only attribute in the same way as files,
however it doesn't really mean anything. Ultimately your best option
may be to do the (write) operation and see if it fails.

Dave
 
Alamelu said:
In Windows XP how to find if a particular path is readonly

For Local path c:\Test
For Network Path \\10.33.33.33\Test
For Mapped Path (subst z: \\10.33.33.33\Test) z:\

I am able to find if a existing file is readonly using GetFileAttribute,
but

That's a nearly useless definition of readonly. The attribute is only a
hint to the user, doesn't actually prevent writing. You most likely need to
do an effective permissions check and that works the same for files and
directories.
 
Back
Top