question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access Denied when using folder ?

See original GitHub issue

Hey. This is a fantastic plugin. Thanks a lot for making it.

I’ve been trying to get this to work all day. I get an access error every time i try to load a folder. Apologies in advance, it’s probably super simple.

When I use

This method: yield return FileBrowser.WaitForLoadDialog( FileBrowser.PickMode.FilesAndFolders, true, null, null, "Load Files and Folders", "Load" );

I get the following error when opening a folder:

UnauthorizedAccessException: Access to the path ‘and insert path here’ is denied;

I’ve tried using the folders only option, but it yields the same result.

I then tried using your other method

FileBrowser.ShowLoadDialog( ( paths ) => { Debug.Log( "Selected: " + paths[0] ); },
								   () => { Debug.Log( "Canceled" ); },
								   FileBrowser.PickMode.Folders, false, null, null, "Select Folder", "Select" );

But my issue here is that I can’t figure out how to read paths[0] afterwards. I tried using OnSuccess but I have no idea how to get the value out of that either.

Hope you can help. An example would be great. Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PlantDadcommented, Feb 3, 2022

I realized what the problem was after reading your reply and answering. I was working from your example and I hadn’t removed the line where it reads the first few bytes of the file, of course that would throw an exception, because the file didn’t exist. The access denied exception threw me off, along with that I didn’t get a printout from earlier in the script than the error occurred. After commenting the line out it works perfectly. Been trying a ton of other things but it’s always something simple. Thanks for the help.

0reactions
PlantDadcommented, Feb 3, 2022

Ah Yeah. I can see it now. I thought it was closed off. Thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Access Denied" or other errors when you access or work ...
Cause An "Access Denied" error message can occur for one or more of the following reasons: The folder ownership has changed. You do...
Read more >
Windows 10/11 "Access Denied" Folder Errors: 5 Easy Fixes
The most common fix to try when you see "folder access denied" is to take ownership of the folder through File Explorer. Here's...
Read more >
How to fix destination folder access denied in Windows 10
9 Ways to Fix Access Denied to Destination Folder in Windows 10 · Change folder ownership · Set permissions for pen drive or...
Read more >
[Solved!] Folder access denied? 4 best methods!
Solution 1. Change folder ownership ... It may happen that you are not the owner of this folder. But that can be fixed!...
Read more >
Top 4 Fixes to "Folder Access Denied on Windows 11/10" ...
1. Go to denied access folder, right click on it, and go for properties. · 2. Navigate the security tab then click on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found