2

How can I change/set permissions of a file or directory using asp.net under mono and apache2?

I have an aspx page that needs to check if a directory exists, if not, it must be created, but with group read permissions set. Tried with DirectorySecurity, but it throws PlatformNotSupportedException.

Apache is using www-data user and all files/folders created are owned by this user, the directory permissions look like this drwx------.

The question is how they can be modified to drwxr-----?

Alex Pacurar
  • 5,801
  • 4
  • 26
  • 33

1 Answers1

7

use Syscall.chmod from Mono.Unix.Native

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
Santiago Corredoira
  • 47,267
  • 10
  • 52
  • 56