You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Directory.CreateDirectory with UnixFileMode: behavior for missing parents #73899
Currently, the mode argument is used to create missing parents too.
I would like to change it to only apply to the leaf directory.
This is consistent with mkdir which doesn't use the -m <mode> argument for parents (-p flag).
It avoids unintentionally creating parent directories with wrong permissions.
For example:
// Create app data folder with `700` permission.stringappPath=Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData,Environment.SpecialFolderOption.DoNotVerify),"my-app");Directory.CreateDirectory(appPath,UnixFileMode.UserRead|UnixFileMode.UserWrite|UnixFileMode.UserExecute);
@eerhardt@adamsitnik @dotnet/area-system-io do you agree? If so, I'll make a PR to implement this change.
@adamsitnik + @jozkee, I know that @eerhardt won't be able to look at this until later in the week. Could one of you two please take a look Monday/Tuesday to see if we can address this with RC1?
Activity
danmoseley commentedon Aug 13, 2022
@eerhardt
jeffhandley commentedon Aug 15, 2022
@adamsitnik + @jozkee, I know that @eerhardt won't be able to look at this until later in the week. Could one of you two please take a look Monday/Tuesday to see if we can address this with RC1?
jozkee commentedon Aug 15, 2022
@tmds the proposed change sounds good to me.