3

I have a C# Mono program (Unity3d game) that unzips a zip archive using SharpZLib. My problem is that when the archive is unzipped on Mac OSX, the file permissions are different. Specifically they are set to 644 while I want them to be 755. I don't know why the file permissions are not kept the same after unzipping, but in any case I need to set permissions for all extracted files to 755 after unzipping.

How can I do this with C#? I also need this to work on Windows and not only Mac OSX but at the worst case I can just have a special code path for Mac.

Note that I cannot use Mono.Posix to do this, because it is not available for my program as Unity3d does not include it in the build.

Thanks in advance.

sirival
  • 255
  • 1
  • 4
  • 12

1 Answers1

2

Nevermind, I did it using System.Diagnostics.Process. That's what I was trying before but I was passing the wrong arguments to chmod and thought that it wasn't working.

sirival
  • 255
  • 1
  • 4
  • 12