Thanks Anatoliy,
It seems like when a file has user restrictions, it does not return the owner of the file. Does this mean that the current user is not allowed to access the file?
We are actually checking if a file (dlls/ocx, etc) exists in the local machine. Our program should be able to detect if a certain file 'physically' exist regardless whether it is hidden, readonly or has restrictions. Apparently, on certain scenarios (for instance file has user restrictions) getfileattr and/or VFP's file() function returns different results (usually file not exist) even though the file really exists on the user's local machine. Where there is are no user rights to a certain file and it exists in the local machine, we display a message to contact sys admin.
We are having a play of the functions (getfilesecurity) in the code you gave. However do you have the values/constants of DACL_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION etc. Or is there a direct way to determine if the user has rights to a folder and/or file?
Thanks in advance.
Regards,
Nitin