-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tvOS] Environment.GetSpecialFolder is too eager in creating the special directories #58787
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsPR #57508 added the following code: runtime/src/mono/System.Private.CoreLib/src/System/Environment.iOS.cs Lines 102 to 111 in 98670d7
While the intention to create The expected version of the code should be closer to string? path = CombineSearchPath(NSSearchPathDirectory.NSLibraryDirectory, Path.Combine("Caches", "Documents"));
// Special version of CombineSearchPath which creates the path if needed.
// This isn't needed for "real" search paths which always exist, but on tvOS
// the base path is really a subdirectory we define rather than an OS directory.
// In order to not treat Directory.Exists(SpecialFolder.ApplicationData) differently
// on tvOS, guarantee that it exists by creating it here
if (!Directory.Exists (path))
Directory.CreateDirectory (path);
path = Path.Combine(path, subdirectory); (ie. only create the base directory and then combine the paths) Ref: dotnet/macios#12640
|
PR #57508 added the following code:
runtime/src/mono/System.Private.CoreLib/src/System/Environment.iOS.cs
Lines 102 to 111 in 98670d7
While the intention to create
ApplicationData
directory is correct the implementation creates also any subdirectory as well which is different from what legacy Mono did and what iOS does.The expected version of the code should be closer to
(ie. only create the base directory and then combine the paths)
Ref: dotnet/macios#12640
The text was updated successfully, but these errors were encountered: