Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by HuginFlight · Jul 15, 2013 at 09:38 AM · c#ioserror messagemacdirectory

Access to path /???? is denied on Mac OS

I download a file and placed it into a directory that I created with code on a Mac but it keeps giving me "Access is denied" error message whenever I try and move or copy that file to a different directory using Directory.Move(). I'm using Application.persistantDataPath, which work great on Windows, but not on a Mac. It also gives me the same problem when I create a iOS build. I have searched the net to find a solution, but non of the answers seems to work for me. I cant be only one with this problem.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by enmeii · Jul 15, 2013 at 09:52 AM

 bundlePathStr += "Sounds" + Path.DirectorySeparatorChar;
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HuginFlight · Jul 15, 2013 at 10:13 AM 0
Share

Sorry, but what's with "Sounds"?

avatar image Owen-Reynolds · Jul 15, 2013 at 02:36 PM 0
Share

I think enmeii is implying that you may be using something like "Sounds\\tweet" on a PC, with the backwards PC pathname slash. And that using Path.DirSepChar ins$$anonymous$$d will correct it to a backslash for a $$anonymous$$ac.

avatar image HuginFlight · Jul 16, 2013 at 05:16 AM 0
Share

you are right, I should start using that, specially when I'm coding for cross platform...thanks

avatar image
0

Answer by Graham-Dunnett · Jul 15, 2013 at 03:18 PM

 Directory.Move(Application.persistentDataPath + "/old", Application.persistentDataPath + "/new");

That worked for me on a Mac. Note that on Mac the app runs in a sandboxed environment. You should not expect to have access to the hard drive of the machine. See:

http://developer.apple.com/library/mac/#documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HuginFlight · Jul 16, 2013 at 05:12 AM 0
Share

Thanks for getting back to me, I'll take some time and go through the Sandbox Design Guide. I though it might have something to do with it, but I was hoping not...

avatar image HuginFlight · Jul 16, 2013 at 07:44 AM 0
Share

I went through most of the Sandbox Design Guide and I realise that I might have to add Entitlements, but have no idea of how to do that in C#, let alone Unity. Surely I must be able to at least run the app within the Unity Editor and write to different directories that I create.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Simultaneous Android and iOS development 1 Answer

Compile a game for iOS, Mac, PC - how much adjustment? 2 Answers

For which Platforms can i build AssetBundles with a Mac 1 Answer

How to load app without developer license 1 Answer

Is it possible to build for iPhone with Unity's iOS license and NO Apple dev account on a Jailbroken device? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges