Annoying "Access to the path is denied" red warnings when browsing files
Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14223
Originally posted by SomeRandomNoobKekeke June 27, 2024
Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [ ] My issue happened while using mods.
What happened?
Game throws a lot of those warnings when browsing files, each time you step inside a folder with readonly files, e.g. when searching thumbnail for a mod or "load texture" in sub or character editor
https://github.com/FakeFishGames/Barotrauma/discussions/13935#discussioncomment-9351763
Reproduction steps
Go to sub editor Shift + rmb add image cilck on different folders / root disks Some might even actually crash the game
Bug prevalence
Happens every time I play
Single player or multiplayer?
Single player
-
No response
Version
v1.5.9.1 (Summer Update Hotfix 2)
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
Red warnings:
Cannot get directories at "C:/Users/user/Application Data": unauthorized access. The folder(s) might be read-only! {Access to the path 'C:\Users\user\Application Data' is denied.}
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
at System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption)
at Barotrauma.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Utils\SafeIO.cs:line 293
Sometimes game even crashes if i click disk g for example
Exception: The directory name 'G:/' does not exist. (Parameter 'path') (System.ArgumentException)
Target site: Void CheckPathValidity(System.String)
Stack trace:
at System.IO.FileSystemWatcher.CheckPathValidity(String path)
at System.IO.FileSystemWatcher..ctor(String path)
at Barotrauma.FileSelection.set_CurrentDirectory(String value) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\FileSelection.cs:line 88
at Barotrauma.FileSelection.<>c.<Init>b__28_0(GUIComponent child, Object userdata) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\FileSelection.cs:line 200
at Barotrauma.GUIListBox.Select(Int32 childIndex, Force force, AutoScroll autoScroll, TakeKeyBoardFocus takeKeyBoardFocus, PlaySelectSound playSelectSound) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 1068
at Barotrauma.GUIListBox.UpdateChildrenRect() in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 788
at Barotrauma.GUIListBox.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 908
at Barotrauma.GUI.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUI.cs:line 1262
at Barotrauma.GameMain.Update(GameTime gameTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 967
at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656
at Microsoft.Xna.Framework.Game.Tick() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397
at Microsoft.Xna.Framework.Game.Run() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367
at Barotrauma.Program.Main(String[] args) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 61
Addressed in https://github.com/FakeFishGames/Barotrauma-development/pull/5533
Got this when I tried ot access a folder which requires admin priviliges to access, didn't create a crash report, compared to the current Unstable build you are able to enter that folder but it just throws errors.
Merged, closing