Windows – Allow seeing if file exists, but not read any data

ntfswindows

Is it possible to set a folder permission so that you (in this case a .net app), can see if a file exists – but not read any data.

I want to be able to set permissions, so:

  1. A user can tell if a file exists
  2. A user can write to the folder.
  3. No other permissions (can't read /
    delete etc).

-thanks
Alex.

Best Answer

Assuming you are talking about Windows...

The logical direct best-effort way to do this, I think, is if you set the permissions on the folder (and you'll have to use the Advanced button within the Security tab in the folder's Properties) to Allow Traverse Folder/Execute File, Allow Create Files/Write Data, and Allow Create Folders/Append Data.

Unfortunately List Folder/Read Data is a single permission so you can't split that up on the permission level from Windows. Users will be able to write and append files and folders, but not list the folders or read the files (or delete them).

However, a good work around would be instead of designing your app to test for the existence of files, test for the existence of folders, and place each file to be secured in its own folder. If you remove the List Folder/Read Data permissions from the folders inside a main folder, you can deny permission to your app of opening the files inside those subfolders, but allow them to see the existence of the subfolders.