Click to See Complete Forum and Search --> : Is directory writeable?


dgill
May 25th, 1999, 04:23 PM
Hi,

Under unix, it is a very simple matter to see if a user can create files in a directory - just check the permissions.

Is there an equivalent function for Win95/NT? Right now, I am creating a temp file in the directory and, if successful - deleting it and returning TRUE. However, it seems to me that there must be an easier way than this!

Any ideas?

Jerome
May 26th, 1999, 02:04 PM
CreateFileEx() ?

dgill
May 26th, 1999, 03:59 PM
Hi Jerome,

I have searched all the WINAPI and MFC headers, and I can't find any reference to CreateFileEx.
Is it in some other library you have? Or is it wishful thinking (Gosh, wouldn't it be great if there was a CreateFileEx function that could....)?


Regards,
Dan Gill

G Kirkham
May 26th, 1999, 04:05 PM
You can use GetFileAttributes to check if a file or directory is read-only (and other info)

Also look at GetFileSecurity