accesing filestream denied for SharpZipLib for Unity3d iOS

725 Views Asked by At

i am trying to unpack a .zip file but when i try to copy the zip stream to the file i get:

UnauthorizedAccessException: Access to the path "/var/mobile/Applications/7209CA86-E88D-4BAC-B285-2912B982E8C0/Documents/Inbox/Book.txt" is denied.
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [0x00000] in <filename unknown>:0 
  at System.IO.File.Create (System.String path, Int32 bufferSize) [0x00000] in <filename unknown>:0 
  at System.IO.File.Create (System.String path) [0x00000] in <filename unknown>:0 

Book.txt is a file of the .zip file.

Here is the code where the problem appears:

using (FileStream streamWriter = File.Create(fullZipToPath)) {
                    StreamUtils.Copy(zipStream, streamWriter, buffer);
                }

The code works well on OS X but on iOS i can't get it fixed. What is the problem?

0

There are 0 best solutions below